#C231. Maximum Concurrent Users

    ID: 45612 Type: Default 1000ms 256MiB

Maximum Concurrent Users

Maximum Concurrent Users

You are given a series of log events representing user login and logout actions in a system. Each event comes with a timestamp in HH:MM format and an associated action (either "login" or "logout"). Your task is to determine the maximum number of users that were concurrently logged in at any point in time.

It is guaranteed that the log events are provided in non-decreasing order according to the timestamps.

In mathematical terms, if we denote the number of users logged in at time (t) as (U(t)), then you need to find (\max_t U(t)).

inputFormat

The first line of input contains a single integer (n) representing the number of log events. The following (n) lines each contain a timestamp (in HH:MM format) followed by an action (either "login" or "logout") separated by space.

outputFormat

Output a single integer representing the maximum number of concurrent users logged in at any moment.## sample

6
09:00 login
09:30 login
10:00 logout
10:30 login
11:00 logout
11:30 logout
2

</p>