#include <bits/stdc++.h>
using namespace std;
int minRooms(const vector<string> &s) {
  int room[7] = {0};
  for (size_t i = 0; i < s.size(); ++i) {
    for (int j = 0; j < 7; ++j) {
      room[j] += s[i][j] - '0';
    }
  }
  int max_room = room[0];
  for (int i = 0; i < 7; ++i) {
    max_room = max(max_room, room[i]);
  }
  return max_room;
}
int main(int argc, char *argv[]) {
  int n;
  cin >> n;
  vector<string> s(n);
  for (int i = 0; i < n; ++i) {
    cin >> s[i];
  }
  cout << minRooms(s) << endl;
  return 0;
}
