What I would do is have just 2 IR sensors spaced out slightly (about 1 foot) then have a logic circuit that can differentiate between which one was triggered first, then that feeds into the counter to count either up or down depending on which one trips first.
Try doing this with some kind of latch that resets after a second or two, and this enable the second IR sensor to trigger a clock pulse. (ie: the one further in the room is triped first, so it allows the second to trigger a clock pulse)
It would also help if you posted the rest of your schematic.