#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  int n, tmp = 1, res = 1;
  cin >> n;
  int A[n][2];
  for (int i = 0; i < n; i++) cin >> A[i][0] >> A[i][1];
  for (int i = 0; i < n - 1; i++) {
    if ((A[i][0] == A[i + 1][0]) && (A[i][1] == A[i + 1][1])) {
      tmp++;
      if (res < tmp) res = tmp;
    } else
      tmp = 1;
  }
  cout << res << endl;
  return EXIT_SUCCESS;
}
