#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, c = 0;
  cin >> n;
  int a, f[7];
  for (int j = 0; j < 7; j++) f[j] = 0;
  for (int i = 0; i < n; i++) {
    cin >> a;
    for (int j = 0; j < 7; j++) {
      if (a % (int)pow(10, 1) == 1) f[j]++;
      a = a / 10;
    }
  }
  for (int i = 0; i < 7; i++) c = max(c, f[i]);
  cout << c;
  return 0;
}
