#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
struct less_second {
  bool operator()(pair<T1, T2> const& a, pair<T1, T2> const& b) const {
    return a.second < b.second;
  }
};
string int_to_string(int a) {
  stringstream ss;
  ss << a;
  return ss.str();
}
string double_to_string(double a) {
  stringstream ss;
  ss << a;
  return ss.str();
}
string float_to_string(float a) {
  stringstream ss;
  ss << a;
  return ss.str();
}
string long_to_string(long a) {
  stringstream ss;
  ss << a;
  return ss.str();
}
string long_long_to_string(long long a) {
  stringstream ss;
  ss << a;
  return ss.str();
}
int string_to_int(string s) { return atoi(s.c_str()); }
float string_to_float(string s) { return atof(s.c_str()); }
long string_to_long(string s) { return atol(s.c_str()); }
long long string_to_long_long(string s) { return atoll(s.c_str()); }
int main() {
  int n;
  cin >> n;
  int maximo = 0;
  map<string, int> mapa;
  string s;
  for (int i = 0; i < n; i++) {
    cin >> s;
    mapa[s]++;
    maximo = max(maximo, mapa[s]);
  }
  cout << maximo;
  return 0;
}
