#include <bits/stdc++.h>
using namespace std;
int mx = INT_MIN, n, a[10];
char x;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= 7; j++) {
      cin >> x;
      a[j] += x - 48;
    }
  }
  for (int i = 1; i <= 7; i++)
    if (mx < a[i]) mx = a[i];
  cout << mx;
}
