#include <bits/stdc++.h>
using namespace std;
const int maxn = 7 + 5;
int n, a[maxn];
char str[maxn];
int main() {
  cin >> n;
  int ans = 0;
  while (n--) {
    cin >> str;
    for (int i = 0; i < 7; i++) {
      a[i] += str[i] - '0';
      ans = max(ans, a[i]);
    }
  }
  cout << ans << endl;
}
