#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100000 + 10;
const int INF = 0x3f3f3f3f;
const int MOD = 1000000000 + 7;
const double EPS = 1E-8;
typedef int ARRAY[MAXN];
typedef bool FLAG[MAXN];
int a[10];
int main() {
  int n;
  scanf("%d%*c", &n);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < 7; ++j) {
      char t;
      scanf("%c", &t);
      a[j] += t - '0';
    }
    scanf("%*c");
  }
  int m = 0;
  for (int i = 0; i < 7; ++i) m = max(m, a[i]);
  printf("%d\n", m);
  return 0;
}
