#include <bits/stdc++.h>
using namespace std;
int main() {
  int num, beshi;
  map<string, int> ami;
  map<int, string> tumi;
  char a[102][102];
  scanf("%d", &num);
  for (int i = 0; i < num; i++) {
    scanf("%s", a[i]);
    ami[a[i]]++;
    tumi[i] = a[i];
  }
  beshi = ami[tumi[0]];
  for (int i = 1; i < num; i++) {
    if (beshi < ami[tumi[i]]) beshi = ami[tumi[i]];
  }
  printf("%d\n", beshi);
  return 0;
}
