#include <bits/stdc++.h>
using namespace std;
int dx[8] = {1, -1, 0, 0, -1, -1, 1, 1};
int dy[8] = {0, 0, -1, 1, -1, 1, -1, 1};
int dirr[] = {-1, -1, 0, 0, 1, 1};
int dirc[] = {0, 1, -1, 1, -1, 0};
int cnt[9];
string s;
int main() {
  int n;
  while (~scanf("%d", &n)) {
    memset(cnt, 0, sizeof(cnt));
    while (n--) {
      cin >> s;
      for (int i = 0; i < s.size(); i++) {
        if (s[i] == '1') cnt[i]++;
      }
    }
    sort(cnt, cnt + 7);
    printf("%d\n", cnt[6]);
  }
  return 0;
}
