#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
const double eps = 1e-9;
const int inf = 1e9;
pair<int, int> a[N];
map<pair<int, int>, int> m;
int main() {
  int n;
  int ans = 1;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i].first >> a[i].second, m[a[i]]++;
  for (auto x : m) ans = max(ans, x.second);
  cout << ans;
}
