#include <bits/stdc++.h>
using namespace std;
using namespace std;
inline bool EQ(double num1, double bin) { return fabs(num1 - bin) < 1e-9; }
const int INF = 1 << 29;
inline int two(int num1) { return 1 << num1; }
inline int test(int num1, int bin) { return (num1 >> bin) & 1; }
inline void set_bit(int& num1, int bin) { num1 |= two(bin); }
inline void unset_bit(int& num1, int bin) { num1 &= ~two(bin); }
inline int last_bit(int num1) { return num1 & (-num1); }
inline int ones(int num1) {
  int res = 0;
  while (num1 && ++res) num1 -= num1 & (-num1);
  return res;
}
using namespace std;
using namespace std;
const int MOD = 1000000007;
double PI = 4 * atan(1);
bool don[105];
vector<int> idxx;
using namespace std;
int num1, count1, num2;
string ss1[1001], ss2;
int main() {
  int n, count = 0, mx = -1;
  cin >> n;
  string arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  for (int i = 0; i < 7; i++) {
    count = 0;
    for (int j = 0; j < n; j++) {
      if (arr[j][i] == '1') {
        count++;
      }
    }
    if (count > mx) {
      mx = count;
    }
  }
  cout << mx;
  return 0;
}
