#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string st[102];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> st[i];
  }
  int a[102];
  memset(a, 0, sizeof(a));
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      if (st[i] == st[j]) {
        a[i]++;
      }
    }
  }
  int maxs = -1;
  for (int i = 0; i < n; i++) {
    if (maxs < a[i]) {
      maxs = a[i];
    }
  }
  cout << maxs + 1 << endl;
  return 0;
}
