#include <bits/stdc++.h>
using namespace std;
int n, m, x, y;
char a[105][105];
int main() {
  int i, j, sol = 0, nr = 0;
  cin >> n;
  for (i = 0; i < n; ++i) cin >> a[i];
  for (i = 0; i < n; ++i) {
    nr = 0;
    for (j = 0; j < n; ++j) {
      if (strcmp(a[i], a[j]) == 0) nr++;
    }
    sol = max(sol, nr);
  }
  cout << sol << "\n";
  return 0;
}
