#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  vector<int> r(7, 0);
  string den;
  for (int i = 0; i < n; i++) {
    cin >> den;
    for (int j = 0; den[j] != '\0'; j++) {
      r[j] += den[j] == '1';
    }
  }
  int m = 0;
  for (int i = 0; i < 7; i++) {
    m = max(m, r[i]);
  }
  printf("%d\n", m);
  getchar();
  getchar();
}
