#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  bool a[n][7];
  for (long long i = 0; i < n; i++) {
    string s;
    cin >> s;
    for (long long j = 0; j < 7; j++) {
      if (s[j] == '0')
        a[i][j] = false;
      else
        a[i][j] = true;
    }
  }
  long long ans = 0;
  for (long long i = 0; i < 7; i++) {
    long long temp = 0;
    for (long long j = 0; j < n; j++) {
      if (a[j][i]) temp++;
    }
    ans = max(ans, temp);
  }
  cout << ans << endl;
  return 0;
}
