#include <bits/stdc++.h>
void solve() {
  int n = 0;
  std::cin >> n;
  std::vector<std::string> gs(n);
  for (int i = 0; i < n; i++) {
    std::cin >> gs[i];
  }
  std::unordered_map<int, int> val;
  for (int i = 0; i < 7; i++) {
    val[i] = 0;
  }
  for (int i = 0; i < n; i++) {
    std::string str = gs[i];
    for (int j = 0; j < str.size(); j++) {
      if (str[j] == '1') {
        val[j]++;
      }
    }
  }
  int max = 0;
  for (auto i = val.begin(); i != val.end(); i++) {
    if (i->second > max) {
      max = i->second;
    }
  }
  std::cout << max;
}
int main() {
  solve();
  return 0;
}
