#include <bits/stdc++.h>
using namespace std;
string I[103];
int main() {
  int n;
  scanf("%d", &n);
  map<string, int> c;
  for (int i = 1; i <= n; i++) {
    cin >> I[i];
    if (c[I[i]] == NULL)
      c[I[i]] = 1;
    else
      c[I[i]]++;
  }
  int ans = 1;
  for (int i = 1; i <= n; i++) {
    ans = ans < c[I[i]] ? c[I[i]] : ans;
  }
  printf("%d\n", ans);
}
