#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  map<string, int> freq;
  for (int i = 0; i < n; i++) {
    string str;
    cin >> str;
    freq[str] += 1;
  }
  int ret = 0;
  for (const auto &p : freq) ret = max(ret, p.second);
  cout << ret << endl;
  return 0;
}
