#include <bits/stdc++.h>
using namespace std;
char s[1005][9];
int main(void) {
  int N;
  scanf("%d", &N);
  int ans = 0;
  for (int i = 0; i < N; i++) {
    scanf("%s", s[i]);
  }
  for (int j = 0; j < 7; j++) {
    int now = 0;
    for (int i = 0; i < N; i++) {
      if (s[i][j] == '1') {
        now++;
      }
    }
    if (ans < now) {
      ans = now;
    }
  }
  printf("%d\n", ans);
}
