#include <bits/stdc++.h>
using namespace std;
const int MAXN = 105;
string str[MAXN];
inline int read() {
  int s = 0, w = 1;
  char ch = getchar();
  while (ch > '9' || ch < '0')
    if (ch == '-') {
      w = -1;
      ch = getchar();
    }
  while (ch >= '0' && ch <= '9') s = s * 10 + ch - '0', ch = getchar();
  return s * w;
}
map<string, int> a;
int main() {
  int n;
  cin >> n;
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    cin >> str[i];
    a[str[i]]++;
    ans = max(ans, a[str[i]]);
  }
  cout << ans;
  return 0;
}
