#include <bits/stdc++.h>
using namespace std;
int nextTime();
char buf[32];
int main() {
  int n, preT = -1, t, freq;
  scanf("%d", &n);
  int days = 1;
  for (int i = 0; i < n; ++i) {
    t = nextTime();
    if (t == preT) {
      ++freq;
      if (freq > 10) {
        freq = 1;
        ++days;
      }
    } else {
      freq = 1;
      if (t < preT) ++days;
    }
    preT = t;
  }
  printf("%d\n", days);
}
int nextTime() {
  do {
    scanf("%s", buf);
  } while (buf[0] != '[');
  int h = (buf[1] - '0') * 10 + (buf[2] - '0');
  int m = (buf[4] - '0') * 10 + (buf[5] - '0');
  scanf("%s", buf);
  if (h != 12) {
    if (buf[0] == 'p') h += 12;
  } else {
    h = buf[0] == 'p' ? 12 : 0;
  }
  int t = (h * 60 + m);
  return t;
}
