#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-6;
const int INF = 0x3f3f3f3f;
const int mod = 1e9 + 7;
const int MAX = 1e6 + 5;
const double PI = acos(-1);
int dir[5][2] = {0, 1, 0, -1, 1, 0, -1, 0};
long long qpow(long long n, long long m) {
  n %= mod;
  long long ans = 1;
  while (m) {
    if (m % 2) ans = (ans * n) % mod;
    m /= 2;
    n = (n * n) % mod;
  }
  return ans;
}
long long inv(long long b) {
  return b == 1 ? 1 : (mod - mod / b) * inv(mod % b) % mod;
}
long long inv2(long long b) { return qpow(b, mod - 2); }
int main() {
  int n, x, y, c, last;
  while (~scanf("%d", &n)) {
    char s[88];
    int a[88] = {0};
    while (n--) {
      scanf("%s", s);
      for (int i = 0; i < 7; i++) {
        a[i] += s[i] - '0';
      }
    }
    int ans = 0;
    for (int i = 0; i < 7; i++) ans = max(ans, a[i]);
    printf("%d\n", ans);
  }
  return 0;
}
