#include <bits/stdc++.h>
using namespace std;
const int inf = INT_MAX;
const int ninf = INT_MIN;
const int M = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(0);
  int n, max = 1;
  string str;
  cin >> n;
  map<string, int> v;
  for (int i = 0; i < n; i++) {
    cin >> str;
    v[str]++;
  }
  for (auto x : v)
    if (x.second > max) max = x.second;
  cout << max << endl;
  return 0;
}
