University Classes

题意翻译

在一个大学里,有$n$个学生小组。在学习交流日里,每个小组可以参与不超过$7$个课程。总共有$7$个时间段分别称为$1$至$7$将分配给这些课程。 现在已经知道了每个小组星期一的计划,即这些小组参与课程的时间段。 你的任务是决定星期一至少需要多少个教室来供这些小组参与课程。一个教室在一个时间段只能容纳一个小组。 输入格式:第一行一个数$n$,表示小组的个数。后$n$行每行$7$个数表示每个小组的安排。这$n$行中,第$i$行第$j$个数表示第$i$个小组在第$j$个时间段的安排,若为$0$,表示无课程,若为$1$,表示有课程。 输出格式:一个数表示你的答案。

题目描述

There are $ n $ student groups at the university. During the study day, each group can take no more than $ 7 $ classes. Seven time slots numbered from $ 1 $ to $ 7 $ are allocated for the classes. The schedule on Monday is known for each group, i. e. time slots when group will have classes are known. Your task is to determine the minimum number of rooms needed to hold classes for all groups on Monday. Note that one room can hold at most one group class in a single time slot.

输入输出格式

输入格式


The first line contains a single integer $ n $ ( $ 1<=n<=1000 $ ) — the number of groups. Each of the following $ n $ lines contains a sequence consisting of $ 7 $ zeroes and ones — the schedule of classes on Monday for a group. If the symbol in a position equals to $ 1 $ then the group has class in the corresponding time slot. In the other case, the group has no class in the corresponding time slot.

输出格式


Print minimum number of rooms needed to hold all groups classes on Monday.

输入输出样例

输入样例 #1

2
0101010
1010101

输出样例 #1

1

输入样例 #2

3
0101011
0011001
0110111

输出样例 #2

3

说明

In the first example one room is enough. It will be occupied in each of the seven time slot by the first group or by the second group. In the second example three rooms is enough, because in the seventh time slot all three groups have classes.