#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string saux;
  getline(cin, saux);
  vector<int> time(n);
  for (int i = 0; i < n; i++) {
    string s;
    getline(cin, s);
    if (s[1] == '1' and s[2] == '2') {
      s[1] = '0';
      s[2] = '0';
    }
    if (s[7] == 'a') {
      time[i] = ((s[1] - '0') * 10 + (s[2] - '0')) * 60 + (s[4] - '0') * 10 +
                (s[5] - '0');
    } else {
      time[i] = (12 + (s[1] - '0') * 10 + (s[2] - '0')) * 60 +
                (s[4] - '0') * 10 + (s[5] - '0');
    }
  }
  int dias = 1;
  int amount = 1;
  for (int i = 1; i < n; i++) {
    if (time[i] < time[i - 1]) {
      dias++;
      amount = 1;
    } else if (time[i] == time[i - 1]) {
      amount++;
      if (amount == 11) {
        amount = 1;
        dias++;
      }
    } else {
      amount = 1;
    }
  }
  cout << dias << endl;
}
