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