#include <bits/stdc++.h>
using namespace std;
map<string, int> M;
long long int n, v = 0, ans = 0;
string r[111], rr[111], clean = "";
void chk(string z) {
  for (int i = 0; i < n; i++) {
    if (z[i] == '0') {
      for (int j = 0; j < n; j++) {
        rr[j][i] = (rr[j][i] == '0' ? '1' : '0');
      }
    }
  }
  long long int ta = 0;
  for (int i = 0; i < n; i++) {
    if (rr[i] == clean) ta++;
  }
  if (ta > ans) ans = ta;
  return;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) clean = clean + "1";
  for (int i = 0; i < n; i++) {
    cin >> r[i];
    if (M.empty())
      M[r[i]] = 1;
    else
      M[r[i]] = M[r[i]] + 1;
  }
  for (int i = 0; i < n; i++) {
    if (M[r[i]] > v) {
      for (int i = 0; i < n; i++) rr[i] = r[i];
      chk(r[i]);
      v = M[r[i]];
    }
  }
  cout << ans;
  return 0;
}
