#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  char a[n][7];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < 7; j++) cin >> a[i][j];
  }
  int ans = 0, ct = 0;
  for (int j = 0; j < 7; j++) {
    ct = 0;
    for (int i = 0; i < n; i++) {
      if (a[i][j] == '1') ct++;
    }
    ans = max(ans, ct);
  }
  cout << ans;
  return 0;
}
