#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string grid[100];
  while (cin >> n) {
    int same = 0;
    for (int i = 0; i < n; i++) cin >> grid[i];
    for (int i = 0; i < n - 1; i++) {
      int temp = 0;
      for (int j = i + 1; j < n; j++) {
        if (grid[i] == grid[j]) temp++;
      }
      if (temp != 0) temp++;
      if (same < temp) same = temp;
    }
    if (same == 0) same++;
    cout << same << endl;
  }
  return 0;
}
