#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a[100005][2], cnt = 1, count = 1, i, temp = 1, j;
  cin >> n;
  for (i = 0; i < n; i++) {
    for (j = 0; j < 2; j++) {
      cin >> a[i][j];
    }
    if (i > 0) {
      if (a[i - 1][0] == a[i][0] && a[i - 1][1] == a[i][1])
        cnt++;
      else {
        cnt = 1;
      }
      temp = cnt;
      if (temp > count) {
        count = temp;
      }
    }
  }
  cout << count;
  return 0;
}
