#include <bits/stdc++.h>
using namespace std;
int compare(const void *a, const void *b) { return (*(int *)a - *(int *)b); }
int main() {
  int n;
  cin >> n;
  char *array;
  array = new char(7);
  int sum[7];
  for (int l = 0; l < 7; ++l) {
    sum[l] = 0;
  }
  for (int i = 0; i < n; ++i) {
    cin >> array;
    for (int k = 0; k < 7; ++k) {
      sum[k] = sum[k] + (array[k] - '0');
    }
  }
  qsort((void *)sum, 7, sizeof(sum[0]), compare);
  cout << sum[6];
  return 0;
}
