#include <bits/stdc++.h>
#pragma warning(disable : 4996)
using namespace std;
int compare(const void *x1, const void *x2) {
  return (*(int *)x1 - *(int *)x2);
}
template <typename T>
T Minimal(T a, T b) {
  return a < b ? a : b;
}
int main() {
  int n;
  cin >> n;
  int *arr = new int[7];
  for (int i = 0; i < 7; i++) arr[i] = 0;
  for (int i = 0; i < n; i++) {
    string str;
    cin >> str;
    for (int j = 0; j < 7; j++)
      if (str[j] == '1') arr[j]++;
  }
  int max = 0;
  for (int i = 0; i < 7; i++)
    if (arr[i] > max) max = arr[i];
  cout << max;
  return 0;
}
