#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, c = 0, p = 0, max = 0;
  ;
  cin >> n;
  int arr1[7];
  for (int i = 0; i < 7; i++) {
    arr1[i] = 0;
  }
  string arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    if (arr[i][0] == '1') {
      arr1[0]++;
    }
    if (arr[i][1] == '1') {
      arr1[1]++;
    }
    if (arr[i][2] == '1') {
      arr1[2]++;
    }
    if (arr[i][3] == '1') {
      arr1[3]++;
    }
    if (arr[i][4] == '1') {
      arr1[4]++;
    }
    if (arr[i][5] == '1') {
      arr1[5]++;
    }
    if (arr[i][6] == '1') {
      arr1[6]++;
    }
  }
  sort(arr1, arr1 + 7);
  cout << arr1[6] << endl;
}
