#include <bits/stdc++.h>
using namespace std;
int main() {
  int x, y, n;
  cin >> n;
  int a, b;
  cin >> a >> b;
  int counter1 = 1, counter2 = 1;
  for (int i = 1; i < n; i++) {
    cin >> x >> y;
    if (a == x && b == y) {
      counter2++;
    } else {
      counter2 = 1;
    }
    if (counter2 > counter1) counter1 += (counter2 - counter1);
    a = x;
    b = y;
  }
  cout << counter1;
}
