#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
template <typename T>
T modpow(T base, T exp, T modulus) {
  base %= modulus;
  T result = 1;
  while (exp > 0) {
    if (exp & 1) result = (result * base) % modulus;
    base = (base * base) % modulus;
    exp >>= 1;
  }
  return result;
}
string decToBinary(long long int n) {
  string r = "";
  for (long long int i = 31; i >= 0; i--) {
    long long int k = n >> i;
    if (k & 1)
      r = r + "1";
    else
      r = r + "0";
  }
  return r;
}
long long int bintodec(long long int a[32]) {
  long long int s = 0, c = 0;
  for (long long int i = 31; i >= 0; i--) {
    if (a[i]) s = s + pow(2, c);
    c++;
  }
  return s;
}
bool isPrime(long long int n) {
  if (n == 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0) return false;
  for (int i = 3; i <= sqrt(n); i = i + 2)
    if (n % i == 0) return false;
  return true;
}
void solve() {
  long long int n, s = 0, c = 0;
  cin >> n;
  long long int f;
  string t[n], a, r;
  for (long long int i = 0; i < n; i++) cin >> t[i];
  for (long long int i = 0; i < n; i++) {
    f = 0;
    a = t[i];
    for (long long int j = 0; j < n; j++) {
      if (a[j] == '0') {
        f = 1;
        break;
      }
    }
    if (f == 0) s++;
  }
  for (long long int i = 0; i < n; i++) {
    c = 0;
    a = t[i];
    for (long long int j = 0; j < n; j++) {
      f = 0;
      r = t[j];
      for (long long int k = 0; k < n; k++) {
        if (i != j && a[k] != r[k]) {
          f = 1;
          break;
        }
      }
      if (f == 0) c++;
    }
    if (c > s) s = c;
  }
  cout << s;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  { solve(); }
  return 0;
}
