#include <bits/stdc++.h>
const double eps = 1e-19;
const double PI = acos(-1.0);
const int INF = 1000 * 1000 * 1000 + 7;
const int MAXN = 100005;
using namespace std;
int n;
pair<int, int> a[MAXN];
int ans;
int main() {
  scanf("%d", &n);
  ans = 1;
  int j = 1;
  scanf("%d %d", &a[0].first, &a[0].second);
  for (int i = 1; i < n; i++) {
    scanf("%d %d", &a[i].first, &a[i].second);
    ans = max(j, ans);
    if (a[i].first == a[i - 1].first && a[i].second == a[i - 1].second)
      j++;
    else
      j = 1;
  }
  ans = max(j, ans);
  cout << ans;
  return 0;
}
