#include <bits/stdc++.h>
using namespace std;
const int N = 7;
char s[N + 5];
int a[N];
int main() {
  int n;
  scanf("%d", &n);
  while (n--) {
    scanf("%s", s);
    for (int i = 0; i < 7; i++) {
      a[i] += s[i] - '0';
    }
  }
  int mx = a[0];
  for (int i = 1; i < 7; i++) mx = max(mx, a[i]);
  cout << mx << endl;
  return 0;
}
