#include
#include
#include
#include
using namespacestd;
const int N =7003;
//1.3000条记录,下列hash函数的效率平均为0.67-0.69,3000/ 7003 = 0.43, hash值数组开得稍大比较合适
//2.7003看起来像素数,适合取余
int cnt[N],hashnum[N];
int n,ans = 0;
//通过位运算,使每一位对hash值都产生影响,分布比较平均
//对长字符串和短字符串都有效。
int ELFhash (char *key )//452ms可能运算较复杂//ELFHash(Exextable and Linking Format ,ELF,可执行链接格式)函数
{
unsignedlong h=0,g;
while (*key)
{
h=(h<<4)+ *key;
key++;
g=h & 0xF0000000L;
if (g) h^=g>>24;
h &= ~g;
}
return h;
}
//unsigned int JSHash(char *str)//436ms
//{
// unsigned int hash = 1315423911; // nearly a prime - 1315423911 = 3 * 438474637
// while (*str)
// {
// hash ^= ((hash << 5) + (*str++) + (hash >> 2));
// }
// return (hash & 0x7FFFFFFF);
//}
//unsigned int SDBMHash(char *str)//436ms
//{
// unsigned int hash = 0;
// while (*str)
// {
// // equivalent to: hash = 65599*hash + (*str++);
// hash = (*str++) + (hash << 6) + (hash << 16) - hash;
// }
// return (hash & 0x7FFFFFFF);//去掉标志位
//}
char str[N][35];
void hashstr(char *s)
{
while (*s =='0') s++;
unsignedint h = ELFhash(s),pos = h %N;
while (hashnum[pos] != h &&hashnum[pos] != -1) pos = (pos +10) % N;//解决冲突
if(hashnum[pos] == -1){
hashnum[pos] = h;
}
cnt[pos] ++;
ans =max(cnt[pos],ans);
}
int main()
{
while (scanf("%d",&n) != EOF) {
memset(hashnum, -1,sizeof(hashnum));
memset(cnt,0, sizeof(cnt));
ans =0;
for (int i =0; i < n; i ++) {
scanf("%s",str[i]);
hashstr(str[i]);
}
printf("%d\n",ans);
}
return0;
}