Detecting input frequency

I would like to feed a square wave signal to arduino (0-5v) and detect when the signal stops.
Signal is approx. 20 Hz. It may not be constant so maybe I can detect absence of further falling or rising edges.

Would it go to a digital or analog pin?
If I understand the logic I can program it. If there is a library out there even better.

All you need to detect is if there is no change on the input for more than 25ms

64GTO:
Would it go to a digital or analog pin?

Digital, although the analog pins can be used for digital signals as well.

64GTO:
If I understand the logic I can program it. If there is a library out there even better.

What you're describing is a watchdog timer. Detect a state change ( IDE -> file/examples/digital) in either direction, use those two to reset a timer. If no more signal change, timer times out... Viola!

Got it!
Thanks