#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s[n];
  unordered_map<string, int> m;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    m[s[i]]++;
  }
  int maxm = 0;
  for (auto itr : m) {
    maxm = max(maxm, itr.second);
  }
  cout << maxm << endl;
  return 0;
}
