#include <bits/stdc++.h>
using namespace std;
char s[105][105];
int f[105];
int main() {
  int n, i, j, k, Max;
  char s1[105];
  cin >> n;
  memset(f, 0, sizeof(f));
  k = 0;
  for (i = 0; i < n; i++) {
    cin >> s1;
    for (j = 0; j < k; j++) {
      if (strcmp(s[j], s1) == 0) {
        f[j]++;
        break;
      }
    }
    if (j == k) {
      f[k] = 1;
      strcpy(s[k++], s1);
    }
  }
  Max = 0;
  for (i = 0; i < k; i++) Max = max(Max, f[i]);
  cout << Max << endl;
  return 0;
}
