题目链接:​​点击打开链接​

B. Ohana Cleans Up

time limit per test

memory limit per test

input

output

n by n

Return the maximum number of rows that she can make completely clean.

Input

n (1 ≤ n ≤ 100).

n lines will describe the state of the room. The i-th line will contain a binary string with n characters denoting the state of the i-th row of the room. The j-th character on this line is '1' if the j-th square in the i-th row is clean, and '0' if it is dirty.

Output

The output should be a single line containing an integer equal to a maximum possible number of rows that are completely clean.

Examples

input

4 0101 1000 1111 0101

output

2

input

3 111 111 111

output

3

Note

In the first sample, Ohana can sweep the 1st and 3rd columns. This will make the 1st and 4th row be completely clean.

In the second sample, everything is already clean, so Ohana doesn't need to do anything.


题意:每次可以打扫一列,一列打扫过后数字会反转,问最多使几行全变为 1

题解:就是求原状态下有几个相同的行;刚开始还以为是求尽可能多的列的相同行,还以为是贪心;ZZ不多说

#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int n;
char a[110][110];
int main()
{
while(~scanf("%d",&n))
{
for(int i=0;i<n;i++)
scanf("%s",a[i]);
int ans=1;
for(int i=0;i<n;i++)
{
int cnt=1;
for(int j=i+1;j<n;j++)
{
if(strcmp(a[i],a[j])==0)
cnt++;
}
ans=max(ans,cnt);
}
printf("%d\n",ans);
}
return 0;
}