grep fix

Was filtering out lines from the input, which was breaking the math. Now grep
counts matches in each line.