#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  map<string, int> mp;
  set<string> st;
  int c = 1;
  int m = 0;
  while (n--) {
    string s;
    cin >> s;
    mp[s]++;
    m = max(m, mp[s]);
  }
  cout << m << endl;
}
