Look up the following sensors: Opto-interrupter, Photo-transistor, Photo-diode, Hall Effect, magnetic reed switch. Pick one.
You can buy ready-made totalizing counters which display the counts in LED or LCD displays.
If you have software capabilities, you can use the sensor to pulse a pin on a computer parallel or serial port, and write the totalizing and display software yourself. Without a lot of work, a parallel port could simultaneously count about a dozen inputs.