#include <bits/stdc++.h>
using namespace std;
bool compareForSecondBeforeFirst(string &first, string &second) {
  if (first[7] > second[7])
    return true;
  else if (first[7] < second[7])
    return false;
  if (first[1] == '1' && first[2] == '2') {
    first[1] = '0';
    first[2] = '0';
  }
  if (second[1] == '1' && second[2] == '2') {
    second[1] = '0';
    second[2] = '0';
  }
  for (int i = 1; i <= 5; i++) {
    if (first[i] > second[i])
      return true;
    else if (first[i] < second[i])
      return false;
  }
  return false;
}
int main() {
  string first, second;
  int logCount;
  cin >> logCount;
  getline(cin, first);
  getline(cin, first);
  int days = 1;
  int count = 0;
  for (int i = 1; i < logCount; i++) {
    getline(cin, second);
    if (compareForSecondBeforeFirst(first, second)) {
      days++;
      count = 0;
    } else {
      count++;
    }
    if (strncmp(first.c_str(), second.c_str(), 8)) {
      count = 0;
    }
    if (count >= 10) {
      days++;
      count = 0;
    }
    first = second;
  }
  cout << days << endl;
  return 0;
}
