#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, res = 0, i, t;
  vector<string> v;
  cin >> n;
  for (i = 0; i < n; i++) {
    string s;
    cin >> s;
    v.push_back(s);
  }
  for (int j = 0; j < 7; j++) {
    t = 0;
    for (i = 0; i < n; i++) {
      if (v[i][j] == '1') t++;
    }
    res = max(t, res);
  }
  cout << res << endl;
}
