#include <bits/stdc++.h>
using namespace std;
map<string, int> mapa;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    mapa[s]++;
  }
  int ans = 0;
  for (auto it = mapa.begin(); it != mapa.end(); it++) {
    ans = max(ans, it->second);
  }
  cout << ans << endl;
  return 0;
}
