#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, max;
  string str;
  cin >> n;
  map<string, int> zp;
  map<string, int>::iterator p;
  max = 0;
  for (i = 0; i < n; i++) {
    cin >> str;
    zp[str]++;
  }
  for (p = zp.begin(); p != zp.end(); p++)
    if (p->second > max) max = p->second;
  cout << max << endl;
}
