#include <bits/stdc++.h>
using namespace std;
const int N = 500 * 1000;
long long tmp, ans, a[N];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    for (int j = 0; j < s.size(); j++) {
      a[j] += s[j] - '0';
      ans = max(ans, a[j]);
    }
  }
  cout << ans;
  return 0;
}
