#include <bits/stdc++.h>
using namespace std;
int n;
char dig[10];
int vis[10];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%s", dig);
    for (int j = 0; j <= 6; ++j)
      if (dig[j] == '1') ++vis[j];
  }
  int ans = 0;
  for (int i = 0; i <= 6; ++i) ans = max(ans, vis[i]);
  printf("%d\n", ans);
  return 0;
}
