#include <bits/stdc++.h>
using namespace std;
char arr[105][105];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  int mxm = 0;
  for (int i = 0; i < n; i++) {
    int cnt = 0;
    for (int j = i + 1; j < n; j++) {
      bool flag = false;
      for (int k = 0; k < n; k++) {
        if (arr[i][k] != arr[j][k]) {
          flag = true;
          break;
        }
      }
      if (flag == false) cnt++;
    }
    mxm = max(mxm, cnt);
  }
  cout << mxm + 1 << endl;
  return 0;
}
