Try this array formula,
=SUM(IF(FREQUENCY(IF(SUBTOTAL(3,OFFSET(C21,ROW(1:15),0)),MATCH(C22:C36,C22:C36,0)),MATCH(C22:C36,C22:C36,0)),1))
Note that there are 15 rows in the C22:C36 (inclusive) and that we start the array processing at C21 since we are offsetting a minimum of 1 row.