#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  int a[n], b[n];
  for (int i = 0; i < n; i++) {
    scanf("%d %d", &a[i], &b[i]);
  }
  int sum = 1;
  int count = 1;
  for (int i = 0; i < n; i++) {
    if (a[i] == a[i + 1] && b[i] == b[i + 1]) {
      count++;
      if (count > sum) sum = count;
    } else
      count = 1;
  }
  printf("%d", sum);
}
