CF237A.Free Cash

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

Valera runs a 24/7 fast food cafe. He magically learned that next day nn people will visit his cafe. For each person we know the arrival time: the ii -th person comes exactly at hih_{i} hours mim_{i} minutes. The cafe spends less than a minute to serve each client, but if a client comes in and sees that there is no free cash, than he doesn't want to wait and leaves the cafe immediately.

Valera is very greedy, so he wants to serve all nn customers next day (and get more profit). However, for that he needs to ensure that at each moment of time the number of working cashes is no less than the number of clients in the cafe.

Help Valera count the minimum number of cashes to work at his cafe next day, so that they can serve all visitors.

输入格式

The first line contains a single integer nn (1<=n<=105)(1<=n<=10^{5}) , that is the number of cafe visitors.

Each of the following nn lines has two space-separated integers hih_{i} and mim_{i} (0<=hi<=23; 0<=mi<=59)(0<=h_{i}<=23; 0<=m_{i}<=59) , representing the time when the ii -th person comes into the cafe.

Note that the time is given in the chronological order. All time is given within one 24-hour period.

输出格式

Print a single integer — the minimum number of cashes, needed to serve all clients next day.

输入输出样例

  • 输入#1

    4
    8 0
    8 10
    8 10
    8 45
    

    输出#1

    2
    
  • 输入#2

    3
    0 12
    10 11
    22 22
    

    输出#2

    1
    

说明/提示

In the first sample it is not enough one cash to serve all clients, because two visitors will come into cafe in 8:10. Therefore, if there will be one cash in cafe, then one customer will be served by it, and another one will not wait and will go away.

In the second sample all visitors will come in different times, so it will be enough one cash.

首页