#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<string> q(n);
  for (int i = 0; i < n; i++) {
    cin >> q[i];
  }
  int max = 0;
  for (int i = 0; i < 7; i++) {
    int cur = 0;
    for (int j = 0; j < n; j++) {
      if (q[j][i] == '1') {
        cur++;
      }
    }
    if (cur > max) max = cur;
  }
  cout << max;
  return 0;
}
