#include <bits/stdc++.h>
using namespace std;
int n, i, mx, t;
pair<int, int> A[100005];
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n; i++) cin >> A[i].first >> A[i].second;
  sort(A + 1, A + n + 1);
  t = mx = 1;
  for (i = 1; i < n; i++) {
    if (A[i].first == A[i + 1].first and A[i].second == A[i + 1].second) {
      t++;
      mx = max(mx, t);
    } else
      t = 1;
  }
  cout << mx;
  return 0;
}
