#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, arr[25][61], temp1, temp2, max = 0, i;
  cin >> n;
  for (i = 0; i < 25; i++) {
    for (int j = 0; j < 61; j++) {
      arr[i][j] = 0;
    }
  }
  for (i = 0; i < n; i++) {
    cin >> temp1;
    cin >> temp2;
    arr[temp1][temp2] += 1;
    if (max < arr[temp1][temp2]) {
      max = arr[temp1][temp2];
    }
  }
  cout << max << endl;
  return 0;
}
