#include <bits/stdc++.h>
using namespace std;
int max(int a, int b) { return a > b ? a : b; }
int main() {
  string s[101];
  int i, j, k, l, n, count = 0, ans = 1;
  cin >> n;
  for (i = 0; i < n; i++) cin >> s[i];
  for (i = 0; i < n; i++) {
    count = 0;
    for (j = 0; j < n; j++) {
      if (s[j].compare(s[i]) == 0) count++;
    }
    ans = max(ans, count);
  }
  cout << ans << endl;
  return 0;
}
