#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<pair<int, int>> v;
  vector<int> vec;
  int n, x, y;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> x >> y;
    v.push_back(pair<int, int>(x, y));
  }
  int count = 1;
  int p = v[0].second, k = v[0].first;
  for (int i = 1; i < v.size(); i++) {
    if (p == v[i].second && k == v[i].first)
      count++;
    else {
      p = v[i].second;
      k = v[i].first;
      count = 1;
    }
    vec.push_back(count);
  }
  sort(vec.begin(), vec.end());
  if (vec.size() == 0) {
    cout << count << endl;
  } else
    cout << vec[vec.size() - 1] << endl;
}
