#include <bits/stdc++.h>
using namespace std;
unsigned long long int mass_long[1000], i2, n, k, i3, maxx, i;
string number, mass[1000];
int main() {
  cin >> n;
  for (i2 = 0; i2 < n; i2++) {
    cin >> number;
    for (i3 = 0; i3 < k; i3++) {
      if (number == mass[i3]) {
        mass_long[i3]++;
        goto exit;
      }
    }
    mass[k] = number;
    k++;
  exit:;
  }
  for (i3 = 0; i3 < k; i3++) {
    if (mass_long[i3] > maxx) maxx = mass_long[i3];
  }
  cout << maxx + 1;
}
