#include <bits/stdc++.h>
using namespace std;
int n, freq[8];
vector<string> v;
int main() {
  scanf("%d", &n);
  v.resize(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    for (int j = 0; j < v[i].size(); j++) {
      freq[j] += (v[i][j] == '1');
    }
  }
  int ans = 0;
  for (int i = 0; i < 7; i++) {
    ans = max(ans, freq[i]);
  }
  printf("%d\n", ans);
}
