Thanks for your quick reply..
I could get your idea but have a doubt..
the output of the flipflop is given to 2 counters ..if the flipflop is set counter 1 is incremented ans if reset counter2 is incremented ..but as soon as the person crosses the first beam ,the flipflop is set (counter1 gets incremented) and when he crosses the second ,the flipflop is reset(counter2 gets incremented)..counting him in both the counters ..could you please help in getting out of this problem