#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n;
  cin >> n;
  string s[n];
  for (long long i = 0; i < n; i++) cin >> s[i];
  long long j = 0, maxi = INT_MIN, res = 0;
  for (long long i = 0; i < 7; i++) {
    res = 0;
    for (long long j = 0; j < n; j++) {
      res += (int)s[j][i] - 48;
    }
    maxi = max(maxi, res);
  }
  cout << maxi << endl;
}
