#include <bits/stdc++.h>
using namespace std;
map<string, int> mp;
string s;
signed main() {
  int n, maxn = 0;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> s;
    mp[s]++;
    maxn = max(maxn, mp[s]);
  }
  cout << maxn << endl;
  return 0;
}
