#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, mx = 0;
  string s;
  map<string, int> m;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s;
    m[s]++;
  }
  for (map<string, int>::iterator it = m.begin(); it != m.end(); it++) {
    if ((*it).second > mx) mx = (*it).second;
  }
  cout << mx << endl;
  return 0;
}
