#include <bits/stdc++.h>
using namespace std;
void fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
int power(int x, unsigned int y) {
  int res = 1;
  while (y > 0) {
    if (y & 1) res = res * x;
    y = y >> 1;
    x = x * x;
  }
  return res;
}
int sigma(long long int n) { return (((n) * (n + 1)) / 2); }
int main() {
  fast();
  long long int n, h, mi, max_coustmers = 1;
  cin >> n;
  map<pair<long long int, long long int>, long long int> m;
  for (int i = 0; i < n; i++) {
    cin >> h >> mi;
    m[make_pair(h, mi)]++;
    if (m[make_pair(h, mi)] > max_coustmers)
      max_coustmers = m[make_pair(h, mi)];
  }
  cout << max_coustmers << "\n";
}
