#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<string> A(n);
  for (int i = 0; i < n; i++) {
    cin >> A[i];
  }
  int fans = 0;
  for (int j = 0; j < 7; j++) {
    int curr = 0;
    for (int i = 0; i < n; i++) {
      curr += A[i][j] - '0';
    }
    fans = max(fans, curr);
  }
  cout << fans;
  return 0;
}
