#include <bits/stdc++.h>
using namespace std;
;
int main() {
  int n;
  cin >> n;
  vector<string> v;
  for (int i = 0; i < n; i++) {
    string temp;
    cin >> temp;
    v.push_back(temp);
  }
  int already = 0;
  for (int i = 0; i < n; i++) {
    int count = 0;
    for (int j = 0; j < n; j++) {
      if (v[i][j] == '1') count++;
    }
    if (count == n) {
      already++;
    }
  }
  map<string, int> m;
  for (int i = 0; i < n; i++) {
    m[v[i]]++;
  }
  int ans = already;
  for (auto it = m.begin(); it != m.end(); it++) ans = max(ans, (*it).second);
  cout << ans << "\n";
  return 0;
}
