#include <bits/stdc++.h>
using namespace std;
const long long INF = numeric_limits<long long>::max();
const long long _INF = numeric_limits<long long>::min();
const long double EPS = 1e-7;
const long long MOD = 1e9 + 7;
const long double PI = acos(-1);
const int MAXN = 100000;
int main() {
  int n;
  cin >> n;
  vector<string> v;
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    v.push_back(s);
  }
  int ans = 0;
  for (int i = 0; i < 7; ++i) {
    int cur = 0;
    for (int j = 0; j < n; ++j) {
      cur += v[j][i] - '0';
    }
    ans = max(ans, cur);
  }
  cout << ans;
  return 0;
}
