#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, max = 0;
  string a[100];
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) {
    int count = 0;
    for (int j = 0; j < n; j++) {
      if (i != j) {
        if (a[i].compare(a[j]) == 0) count++;
      }
    }
    if (count > max) max = count;
  }
  cout << max + 1;
  return 0;
}
