#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int n;
  cin >> n;
  string s;
  map<string, int> mp;
  for (int i = 0; i < n; ++i) {
    cin >> s;
    mp[s]++;
  }
  int ans = 0;
  for (auto ss : mp) {
    ans = max(ans, ss.second);
  }
  cout << ans << endl;
  return 0;
}
