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