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