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