#include <bits/stdc++.h>
int main() {
  int i, j, k, l, n, count = 0, max = 0;
  scanf("%d", &n);
  char a[n + 1][n + 1];
  for (i = 0; i < n; i++) {
    scanf("%s", a[i]);
  }
  for (i = 0; i < n; i++) {
    count = 0;
    for (j = i + 1; j < n; j++) {
      l = strcmp(a[i], a[j]);
      if (l == 0) {
        count++;
      }
    }
    if (count > max) max = count;
  }
  printf("%d", max + 1);
  return 0;
}
