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