#include <bits/stdc++.h>
using namespace std;
int cnv(char c) {
  if (c == '1')
    return 1;
  else
    return 0;
}
int main() {
  ios::sync_with_stdio(0);
  int n;
  cin >> n;
  vector<string> a(n);
  for (int(i) = 0; (i) < (n); (i)++) cin >> a[i];
  int cur = 0, mx = 0;
  for (int(i) = 0; (i) < (7); (i)++) {
    cur = 0;
    for (int(j) = 0; (j) < (n); (j)++) cur += cnv(a[j][i]);
    mx = max(mx, cur);
  }
  cout << mx;
  return 0;
}
