#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m = 0;
  cin >> n;
  string a[n];
  for (int i = 0; i < n; cin >> a[i++])
    ;
  for (int i = 0; i < 7; i++) {
    int s = 0;
    for (int j = 0; j < n; j++) s += a[j][i] - '0';
    m = max(m, s);
  }
  cout << m << endl;
  return 0;
}
