#include <bits/stdc++.h>
using namespace std;
int ret = 0;
int mat[24][60];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    mat[x][y]++;
    ret = max(ret, mat[x][y]);
  }
  printf("%d\n", ret);
  return 0;
}
