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