#include <bits/stdc++.h>
using namespace std;
int main() {
  string str[101];
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> str[i];
  int maxi = 1;
  for (int i = 0; i < n - 1; ++i) {
    int m = 1;
    for (int j = i + 1; j < n; ++j) {
      if (str[i] == str[j]) ++m;
    }
    maxi = max(m, maxi);
  }
  cout << maxi << endl;
  return 0;
}
