#include <bits/stdc++.h>
using namespace std;
const int N = 111;
int n;
string a[N];
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> a[i];
  int mx = 0;
  for (int i = 0; i < n; ++i) {
    int cnt = 0;
    for (int j = i; j < n; ++j) {
      if (a[i] == a[j]) ++cnt;
    }
    mx = max(mx, cnt);
  }
  cout << mx << endl;
}
