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