#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<string> v(n);
  for (int i = 0; i < n; i++) cin >> v[i];
  int c = 0;
  int m = 0;
  for (int i = 0; i < n; i++) {
    c = 0;
    for (int j = 0; j < n; j++) {
      if (v[i] == v[j]) c++;
    }
    if (c > m) m = c;
  }
  cout << m << endl;
  return 0;
}
