#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> u;
  int mx = 0, ch = 0, n;
  cin >> n;
  string r[n];
  for (int i = 0; i < n; i++) cin >> r[i];
  for (int i = 0; i < 7; i++) {
    for (int j = 0; j < n; j++) {
      if (r[j][i] == '1') {
        ch++;
      }
    }
    u.push_back(ch);
    ch = 0;
  }
  sort(u.begin(), u.end());
  cout << u[u.size() - 1];
  return 0;
}
