#include <bits/stdc++.h>
using namespace std;
struct cmpStruct {
  bool operator()(int const& lhs, int const& rhs) const { return lhs > rhs; }
};
int main() {
  int num1;
  int temp1, temp2, ans, MIN;
  pair<int, int> p1;
  set<pair<int, int> > s1;
  cin >> num1;
  ans = 0;
  vector<pair<int, int> > v1;
  MIN = 0;
  for (int A = 1; A <= num1; A++) {
    cin >> temp1 >> temp2;
    p1 = make_pair(temp1, temp2);
    v1.push_back(p1);
  }
  sort(v1.begin(), v1.end());
  for (int A = 0; A < v1.size(); A++) {
    p1 = v1[A];
    if (s1.find(p1) != s1.end())
      ans++;
    else
      ans = 0;
    MIN = max(ans, MIN);
    s1.insert(p1);
  }
  cout << MIN + 1 << endl;
}
