最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(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的評論 (共 條)

分享到微博請遵守國家法律
思南县| 湖州市| 淅川县| 玉山县| 革吉县| 潜山县| 河池市| 革吉县| 津市市| 鄢陵县| 合肥市| 墨玉县| 玉门市| 库伦旗| 恭城| 辰溪县| 綦江县| 子长县| 嘉善县| 滨州市| 宁津县| 玛曲县| 兰西县| 海宁市| 郓城县| 仁化县| 潮安县| 镇安县| 修文县| 武安市| 穆棱市| 三明市| 依安县| 泰州市| 通榆县| 惠东县| 微博| 同心县| 雷州市| 大悟县| 东山县|