#include <bits/stdc++.h>
const int MAX = 1e5 + 35;
using namespace std;
pair<int, int> a[MAX];
int b[MAX];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i].first >> a[i].second;
  }
  sort(a, a + n);
  int s = 1;
  if (n == 1)
    cout << 1;
  else {
    for (int i = 1; i < n; i++) {
      if (a[i].first == a[i - 1].first && a[i].second == a[i - 1].second)
        s++;
      else
        s = 1;
      b[i - 1] = s;
    }
    sort(b, b + n);
    cout << b[n - 1];
  }
  return 0;
}
