#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<string> v;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    v.push_back(s);
  }
  sort(v.begin(), v.end());
  int i = 0, c, mx = -1;
  while (true) {
    c = count(v.begin(), v.end(), v[i]);
    i += c;
    mx = max(mx, c);
    if (i >= v.size()) break;
  }
  cout << mx;
  return 0;
}
