#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, co, large;
  string str[105];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> str[i];
  }
  large = -1;
  for (int i = 0; i < n; i++) {
    co = 0;
    for (int j = 0; j < n; j++) {
      if (str[i].compare(str[j]) == 0) {
        co++;
      }
    }
    if (co > large) {
      large = co;
    }
  }
  cout << large << "\n";
  return 0;
}
