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