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