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