Answer:
A: First you need a object detector that give out a pulse per each. That becomes the clock for any the input to a counter that will count up in binary coded decimal and of these there are many to choose from. Eventually it will fill up and starts over unless there is a reset along the time of counting. that is the basic.