#include <bits/stdc++.h>
using namespace std;
string s[105];
string t;
multiset<string> ms;
multiset<string>::iterator itr;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n, cnt, ans;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    ms.insert(s[i]);
  }
  cnt = 1;
  ans = -1;
  itr = ms.begin();
  t = *itr;
  itr++;
  for (; itr != ms.end(); itr++) {
    if (*itr == t)
      cnt++;
    else
      cnt = 1;
    if (ans < cnt) ans = cnt;
    t = *itr;
  }
  if (ans < cnt) ans = cnt;
  cout << ans << endl;
  return 0;
}
