#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, o = 0, f = 0, c;
  cin >> n;
  string s;
  map<string, int> m;
  int mx = 0;
  for (int i = 0; i < n; i++) {
    cin >> s;
    m[s]++;
    mx = max(mx, m[s]);
  }
  cout << mx;
}
