#include <bits/stdc++.h>
int hash[100][100] = {0};
int main() {
  int n;
  scanf("%d", &n);
  int i, l, m, max = 0;
  for (i = 0; i < n; i++) {
    scanf("%d %d", &l, &m);
    hash[l][m]++;
    if (hash[l][m] > max) max = hash[l][m];
  }
  printf("%d\n", max);
}
