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