#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i;
  cin >> n;
  int x, y;
  map<pair<int, int>, int> mp;
  for (i = 0; i < n; i++) {
    cin >> x >> y;
    mp[{x, y}]++;
  }
  int m = INT_MIN;
  for (auto z : mp) {
    m = max(m, z.second);
  }
  cout << m << endl;
}
