#include <bits/stdc++.h>
using namespace std;
int a[100000], m, c, n = 1, i, b, t = 1;
int main() {
  cin >> m;
  for (i = 1; i <= m; i++) {
    cin >> c >> b;
    a[i] = 100 * c + b;
  }
  for (i = 1; i < m; i++) {
    if (a[i] == a[i + 1])
      n++;
    else
      n = 1;
    if (t < n) t = n;
  }
  cout << t << endl;
  return 0;
}
