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