#include <bits/stdc++.h>
using namespace std;
const int INF = 2000000000;
const int MAX = 10000000;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  while (cin >> n) {
    map<string, int> m;
    for (int i = 0; i < n; i++) {
      string s;
      cin >> s;
      m[s]++;
    }
    int mx = 0;
    for (map<string, int>::iterator it = m.begin(); it != m.end(); it++)
      mx = max(mx, it->second);
    cout << mx << "\n";
  }
  return 0;
}
