五月天青色头像情侣网名,国产亚洲av片在线观看18女人,黑人巨茎大战俄罗斯美女,扒下她的小内裤打屁股

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

CF 847G - University Classes

2023-06-28 14:29 作者:您是打尖兒還是住店呢  | 我要投稿

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.

Input

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.

Output

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

Examples

input

2
0101010
1010101

output

1

input

3
0101011
0011001
0110111

output

3

Note

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.

-------------------------------------

easy題目,找到每一列中1的數(shù)量,每次保留最大值,依次遍歷即可得出;

下面是代碼:


CF 847G - University Classes的評論 (共 條)

分享到微博請遵守國家法律
武夷山市| 遂昌县| 丰城市| 前郭尔| 科技| 陇西县| 历史| 黄龙县| 溆浦县| 博客| 江山市| 交城县| 英吉沙县| 龙陵县| 浦县| 南陵县| 旅游| 武宣县| 浠水县| 普陀区| 永宁县| 新津县| 建瓯市| 香港| 辛集市| 姚安县| 南安市| 和田县| 绥宁县| 丹东市| 广元市| 保德县| 三亚市| 梅河口市| 巩留县| 上饶县| 贡嘎县| 土默特左旗| 格尔木市| 克什克腾旗| 新巴尔虎左旗|