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