Try this in C18:

=SUMPRODUCT(($A$2:$A$12=A18)*($B$2:$B$12=B18),$C$2:$C$12) and copy down.