#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, cash = 1, counter = 1;
  cin >> n;
  int array[n][2];
  cin >> array[0][0] >> array[0][1];
  int x = array[0][0];
  int y = array[0][1];
  for (int i = 1; i < n; i++) {
    cin >> array[i][0] >> array[i][1];
    if (array[i][0] == x && array[i][1] == y)
      counter++;
    else if (counter > cash) {
      cash = counter;
      counter = 1;
    } else
      counter = 1;
    x = array[i][0];
    y = array[i][1];
  }
  if (counter > cash) cash = counter;
  cout << cash << endl;
}
