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