Use COUNT.
COUNT=counts the number of pulses on a pin.
PULSIN=measures pulse width on a pin.