#include <bits/stdc++.h>
using namespace std;
vector<int> v(7);
int main() {
  int n;
  string s;
  cin >> n;
  for (int j = 0; j < n; j++) {
    auto a = 0;
    cin >> s;
    for (auto &c : s) {
      int r = c - 48;
      v.at(a) += r;
      a++;
    }
  }
  auto result = *max_element(v.begin(), v.end());
  cout << result;
  return 0;
}
