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