#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  map<pair<int, int>, int> m;
  for (int i = 0; i < n; ++i) {
    int a, b;
    cin >> a >> b;
    m[{a, b}]++;
  }
  vector<int> v;
  for (auto &i : m) {
    v.push_back(i.second);
  }
  sort(v.begin(), v.end());
  cout << v[v.size() - 1];
}
