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