#include <bits/stdc++.h>
using namespace std;
float ar[100005];
int dp[100005];
int main() {
  int n, i, max;
  float a, b;
  while (cin >> n) {
    for (i = 0; i < n; i++) {
      cin >> a >> b;
      ar[i] = a + b / 100;
    }
    max = 1;
    dp[0] = 1;
    for (i = 1; i < n; i++) {
      if (ar[i] == ar[i - 1])
        dp[i] = dp[i - 1] + 1;
      else
        dp[i] = 1;
      if (dp[i] > max) max = dp[i];
    }
    cout << max << "\n";
  }
  return 0;
}
