#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, finall = 0, t1 = 0;
  vector<string> v;
  cin >> n;
  int cop = n;
  while (n--) {
    string s;
    cin >> s;
    v.push_back(s);
  }
  for (int j = 0; j < 7; j++) {
    t1 = 0;
    for (int k = 0; k < cop; k++) t1 += v[k][j] - '0';
    if (t1 > finall) finall = t1;
  }
  cout << finall;
  return 0;
}
