#include <bits/stdc++.h>
int n, cnt, st;
int h[200], s[200], c[200];
int main() {
  scanf("%d\n", &n);
  for (int i = 0; i < n; i++) {
    scanf("[%d:%d %c.m.]: ", &h[i], &s[i], &c[i]);
    if (c[i] == 'p') h[i] += 12;
    if (h[i] % 12 == 0) h[i] -= 12;
    for (int c = getc(stdin); c != '\n'; c = getc(stdin))
      ;
  }
  for (int i = 1; i < n; i++) {
    if (h[i] != h[i - 1] || s[i] != s[i - 1]) st = i;
    if (i - st == 10)
      st = i, cnt++;
    else if (h[i] < h[i - 1] || (h[i] == h[i - 1] && s[i] < s[i - 1]))
      cnt++, st = i;
  }
  printf("%d\n", cnt + 1);
  return 0;
}
