I'm working on a personal project that will count the number of people entering a room. The circuitry for this is fairly simple, but the problem I am facing involves people being counted when they leave the room. The plan is to use infrared sensors to detect a person passing through the door. What I need is for the counter to increment once every two times the sensor triggers the circuit. I have considered latches, flip-flops, counters,and a mux but cannot find any way to accomplish what I need. Have I missed something or is there something I have not considered?