buy a counter kit or make one yourself. They essentially consist of connected counter chips (one for each digit) and BCD decoder chips that convert the binary count into a form that is useful to display on a seven segment display.
The way these work is that upon the rising edge of a clock (voltage signal), the counter will increment by one. The trick is to exploit some component of the printing process to automatically create a pulse and hence a rising edge.
Maybe think of mounting a hinged switch that swings up and hits a contact when paper hits it on route to the tray.
Don't forget to debounce your switch though.