#include <bits/stdc++.h>
using namespace std;
map<pair<int, int>, int> m;
int main() {
  int n, a, b, maxn = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d%d", &a, &b);
    if (m.find(make_pair(a, b)) != m.end()) {
      m[make_pair(a, b)]++;
    } else {
      m[make_pair(a, b)] = 1;
    }
  }
  for (map<pair<int, int>, int>::iterator it = m.begin(); it != m.end(); it++) {
    maxn = (maxn) > (it->second) ? (maxn) : (it->second);
  }
  printf("%d", maxn);
  return 0;
}
