#include <bits/stdc++.h>
using namespace std;
int a, mx, co;
string s[109];
int main() {
  cin >> a;
  for (int i = 1; i <= a; i++) cin >> s[i];
  for (int i = 1; i <= a; i++) {
    for (int j = i + 1; j <= a; j++)
      if (s[i] == s[j]) co++;
    mx = max(co, mx);
    co = 0;
  }
  cout << mx + 1 << endl;
  return 0;
}
