#include <bits/stdc++.h>
using namespace std;
inline void read_string_to_vector(vector<string> &vec) {
  string str;
  getline(cin, str);
  vec.push_back(str);
}
template <typename T>
inline void read_digit_to_vector(vector<T> &vec) {
  T t;
  cin >> t;
  vec.push_back(t);
}
long long n;
char s[10];
long long answ[7];
long long ra;
int main(void) {
  scanf("%lld", &n);
  for (register long long i = 0; i < n; ++i) {
    scanf("%s", s);
    for (register long long i = 0; i < 7; ++i) answ[i] += s[i] - '0';
  }
  for (register long long i = 0; i < 7; ++i) ra = max(ra, answ[i]);
  printf("%lld\n", ra);
  return 0;
}
