How many IO pins in C8051F975
There are 24 pins (+ GND pad) on the QFN-24 package on page 38. 

2 pins are VDD and GND -> 22pins.
1 pin is RST/C2CK -> 21. 

If you want to use a hardware debugger, then do not use
1 pin P5.2/C2D as an I/O -> 20 I/O pins.