#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d, n, m = 1, e = 1;
  cin >> n;
  while (n--) {
    cin >> a >> b;
    if (a == c && b == d) {
      e++;
      m = max(e, m);
    } else
      e = 1;
    c = a;
    d = b;
  }
  cout << m;
}
