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