#K13216. Maximum People in Museum
Maximum People in Museum
Maximum People in Museum
You are given a log of events representing people entering and exiting a museum. Each event is either an "entry" or an "exit". Your task is to determine the maximum number of people present in the museum at any single point in time.
Each log entry increases the current count if it is an "entry" and decreases the count if it is an "exit". It is guaranteed that the log is consistent (i.e. the number of people in the museum never goes negative).
Note: Use standard input (stdin) for reading input and standard output (stdout) for printing the result.
inputFormat
The input is read from standard input and consists of:
- An integer n representing the number of log entries.
- n lines, each line is either "entry" or "exit" indicating the type of event.
outputFormat
Output a single integer which is the maximum number of people simultaneously present in the museum.
## sample6
entry
entry
exit
entry
entry
exit
3