#include <bits/stdc++.h>
using namespace std;
int main() {
  string s[105];
  int n;
  int i, j, k, c = 0, ans = 0, d = 0;
  cin >> n;
  for (i = 1; i <= n; i++) cin >> s[i];
  for (i = 1; i <= n; i++) {
    d = 0;
    for (j = 1; j <= n; j++) {
      if (s[i] == s[j]) d++;
    }
    ans = max(ans, d);
  }
  cout << ans << endl;
}
