There was a similar question asked two months ago.
Counting no of '>' symbol in a file
In reply to Re: Faster way to do this? by Lotus1 in thread Faster way to do this? by Anonymous Monk