...
The real trick is to come up with sensors and a traffic control system to unambiguously detect people entering and exiting.
That is invariably the hardest part... there are so many things that can go "wrong" especially with people, on their own, on crutches, in wheelchairs, on mobility scooters, with or without children in tow, with pushchairs, dragging suitcases, to name a few "problem" areas.
This assignment is most often presented as a Car Park application, where cars are counted entering and leaving, and a FULL sign is illuminated (and entry barrier inhibited) when there are no spaces left. A very similar task, I'm sure all would agree, and a great deal simpler to do the "detection" part.....
Thankfully, this is an assignment, I would hate to have to work on this. Actually I can't see why you would want to know if the mall is "empty".... you surely wouldn't be locking doors and setting intruder alarms based on a door-count !!!
Design considerations for counting then (leaving aside the problems in detecting)....
Simple approach - use 1 counter.... make a counter "count UP" when someone enters by any of the 3 doors, similarly "count DOWN" when someone leaves by any of the 3 doors. This could work, but problems might exist if there were multiple and simultaneous "triggers" from the door sensors, extra logic in the form of "sensor memory bits" could be used to overcome this, but it gets messy.
Less simple, but more robust - use a separate counter for each door. The number of people in the mall would be the sum of the counter accumulator values. This could have a problem if people habitually and consistently enter via one door, and leave via another.... one counter would spiral upwards, and another spiral downwards, and if left unchecked, eventually the counters would over, or under-flow. I said "if left unchecked", there is a
very simple way to prevent this from occurring....
More complicated, but as robust as you are going to get, is to forget "counters" altogether, but since wilma needs to learn about counters, as opposed to "counting", I'll stop there.