#include <bits/stdc++.h>
using namespace std;
int n, pas[100005];
int main() {
  int a, b;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d %d", &a, &b);
    pas[i] = a * 100 + b;
  }
  int ret = 0;
  for (int i = 0; i < n;) {
    int ctr = 0;
    for (int j = i; j < n; ++j) {
      if (pas[j] != pas[i]) break;
      ctr++;
    }
    ret = max(ret, ctr);
    i += ctr;
  }
  printf("%d\n", ret);
  return 0;
}
