#include <bits/stdc++.h>
using namespace std;
int dp[25][70];
int n;
int main() {
  int i, j, ma, h, m;
  while (scanf("%d", &n) != EOF) {
    ma = 0;
    memset(dp, 0, sizeof(dp));
    for (i = 0; i < n; i++) {
      scanf("%d%d", &h, &m);
      dp[h][m]++;
      ma = max(dp[h][m], ma);
    }
    printf("%d\n", ma);
  }
  return 0;
}
