#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, l, h, m, prevh, prevm, days = 1, sametime = 1;
  char aline[40];
  cin >> n;
  cin.getline(aline, 38);
  for (l = 0; l < n; l++) {
    cin.getline(aline, 38);
    h = (aline[1] - '0') * 10 + aline[2] - '0';
    m = (aline[4] - '0') * 10 + aline[5] - '0';
    if (h == 12) h = 0;
    if (aline[7] == 'p') h += 12;
    if (l) {
      if (h == prevh && m == prevm) {
        if (++sametime > 10) {
          days++;
          sametime = 1;
        }
      } else {
        if (h < prevh || (h == prevh && m < prevm)) days++;
        sametime = 1;
      }
    }
    prevh = h;
    prevm = m;
  }
  cout << days << '\n';
  return 0;
}
