#include <bits/stdc++.h>
using namespace std;
long long po(long long a, long long b) {
  long long x = 1, y = a;
  while (b > 0) {
    if (b % 2) {
      x = x * y;
      x %= 1000000007;
    }
    y = y * y;
    y %= 1000000007;
    b /= 2;
  }
  return x;
}
int main() {
  if (0) {
    freopen("C:/Users/gold/Desktop/sublime IO/input.txt", "r", stdin);
    freopen("C:/Users/gold/Desktop/sublime IO/output.txt", "w", stdout);
  }
  int T = 1;
  while (T--) {
    int n;
    scanf("%d", &n);
    static int cnt[55];
    int ans = 0;
    for (int i = 0; i < n; i++) {
      static char str[55];
      scanf("%s", str);
      int n1 = strlen(str);
      for (int j = 0; j < n1; j++) {
        if (str[j] == '1') {
          cnt[j]++;
        }
        ans = max(ans, cnt[j]);
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
