#include <bits/stdc++.h>
using namespace std;
template <class T>
T MAX(T a, T b) {
  return a > b ? a : b;
}
template <class T>
T MIN(T a, T b) {
  return a < b ? a : b;
}
template <class T1>
void deb(T1 p) {
  cout << "Debugging: " << p << endl;
}
template <class T1, class T2>
void deb(T1 p, T2 q) {
  cout << "Debugging: " << p << "\t" << q << endl;
}
template <class T1, class T2, class T3>
void deb(T1 p, T2 q, T3 r) {
  cout << "Debugging: " << p << "\t " << q << "\t " << r << endl;
}
template <class T1, class T2, class T3, class T4>
void deb(T1 p, T2 q, T3 r, T4 s) {
  cout << "Debugging: " << p << "\t " << q << "\t " << r << "\t " << s << endl;
}
long long int POOW(int b, int p) {
  if (p == 0) return 1;
  return b * POOW(b, p - 1);
}
const int xx[] = {0, 0, 1, -1, -1, 1, -1, 1};
const int yy[] = {1, -1, 0, 0, 1, 1, -1, -1};
const int kx[] = {-2, -1, 1, 2, 2, 1, -1, -2};
const int ky[] = {1, 2, 2, 1, -1, -2, -2, -1};
int main() {
  char mat[105][105];
  int i, j, m, sum, res = 0, ar[105], n, k;
  scanf("%d", &n);
  getchar();
  for (i = 0; i < n; i++) gets(mat[i]);
  res = sum = 0;
  for (i = 0; i < n; i++) {
    sum = 0;
    for (j = 0; j < n; j++) {
      for (k = 0; k < n; k++) {
        if (mat[i][k] == mat[j][k])
          ;
        else {
          break;
        }
      }
      if (k == n) sum++;
    }
    res = max(res, sum);
  }
  sum = 0;
  for (i = 0; i < n; i++) {
    for (j = k = 0; j < n; j++) {
      if (mat[i][j] == '1') ++k;
    }
    if (k == n) sum++;
  }
  if (res == 0) res = max(res, sum);
  printf("%d\n", res);
  return 0;
}
