#include <bits/stdc++.h>
using namespace std;
const long long INF = (1LL << 60) - 1;
const long long maxN = 1000001;
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long tc = 1;
  while (tc--) {
    long long n;
    cin >> n;
    map<long long, long long> fre;
    for (long long i = 0; i < n; ++i) {
      string s;
      cin >> s;
      for (long long j = 0; j < ((long long)(s).size()); ++j) {
        if (s[j] == '1') fre[j + 1]++;
      }
    }
    long long Max = 0;
    for (auto it : fre) Max = max(Max, it.second);
    cout << Max << "\n";
  }
}
