#include <bits/stdc++.h>
using namespace std;
int n, k;
int ch = 0, nch = 0;
int main() {
  string s[110];
  int n;
  int res = -1;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> s[i];
    int eq = 0;
    for (int j = 0; j < i; ++j) {
      if (s[j] == s[i]) eq++;
    }
    res = max(res, eq + 1);
  }
  cout << res << endl;
  return 0;
}
