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