#include <bits/stdc++.h>
using namespace std;
int const nMax = 40000;
map<pair<int, int>, int> Q;
int main() {
  int n;
  int ans = 0;
  scanf("%d", &n);
  pair<int, int> a;
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &a.first, &a.second);
    if (Q.find(a) == Q.end()) {
      Q[a] = 1;
    } else {
      Q[a] = Q[a] + 1;
    }
    if (Q[a] > ans) ans = Q[a];
  }
  printf("%d\n", ans);
  return 0;
}
