yeah, bro
you can do this using any of the available sensors(that may fit best for use) like that of laser diode etc..
you may put two laser diode one after another.... name them A and B..
connect them over interrupts of 89s52
if A comes first then B comes.. this means someone has entered..increase the counter
if B comes first then A comes...this means someone has left... decrease the counter
show watever you want to display on lcd...
use C or assembly (whichever is applicable..)
hope it helps...