# include <bits/stdc++.h>
using namespace std;
int has(char *c) {
unsigned int res = 0;
unsigned int len = strlen(c + 1);
for(unsigned int i = 1; i <= len; i++) {
res = res * 127 + c[i] - '0';
}
return res;
}
char s[103];
int n, ans;
map<int, int> cnt;
int main() {
freopen("string_.in", "r", stdin);
freopen("string_.out", "w", stdout);
scanf("%d", &n);
for(int i = 1; i <= n; i++) {
scanf("%s", s + 1);
ans = max(++cnt[has(s)], ans);
}
printf("%d\n", ans);
}