#include <bits/stdc++.h>
using namespace std;
const long long N = 1e6 + 1;
const long long INF = 1e18;
const long long mod = 1e9 + 7;
int n, u[N], mx;
string s;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> s;
    for (int j = 1; j <= 7; j++) {
      u[j] += s[j - 1] - 48;
    }
  }
  for (int i = 1; i <= 7; i++) {
    mx = max(mx, u[i]);
  }
  cout << mx;
}
