国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

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

分享到微博請遵守國家法律
濮阳县| 新沂市| 黄骅市| 阿克| 安庆市| 吉隆县| 江都市| 临沧市| 江永县| 郁南县| 舟山市| 班玛县| 荣昌县| 无锡市| 平舆县| 沽源县| 若尔盖县| 望江县| 武定县| 赣州市| 宜阳县| 轮台县| 镇原县| 静安区| 平江县| 德保县| 利津县| 清镇市| 二手房| 横峰县| 井研县| 荃湾区| 绿春县| 红桥区| 盱眙县| 枣阳市| 攀枝花市| 平山县| 五大连池市| 龙门县| 铁岭县|