#include <bits/stdc++.h>
using namespace std;
clock_t start_time, end_time;
inline float ellapse() { return (clock() - start_time) * 1.0 / CLOCKS_PER_SEC; }
long long int gcd(long long int a, long long int b) {
  return b == 0 ? a : gcd(b, a % b);
}
long long power(long long a, long long b) {
  long long ret = 1;
  while (b) {
    if (b % 2 == 1) ret = (ret * a) % 1000000007;
    a = (a * a) % 1000000007;
    b /= 2;
  }
  return ret;
}
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 sum = 0;
    for (int j = 0; j < n; j++) {
      sum += a[j][i] - '0';
    }
    ans = max(ans, sum);
  }
  cout << ans;
  return 0;
}
