#include <bits/stdc++.h>
int main() {
  int i, n, a, b, c, d;
  scanf("%d\n", &n);
  b = -1;
  c = d = 1;
  for (i = 0; i < n; i++) {
    static char line[64];
    int h, m;
    fgets(line, 64, stdin);
    h = (line[1] - '0') * 10 + (line[2] - '0');
    m = (line[4] - '0') * 10 + (line[5] - '0');
    h %= 12;
    if (line[7] == 'p') h += 12;
    a = h * 60 + m;
    if (b < a)
      c = 1;
    else if (b == a && c < 10)
      c++;
    else {
      d++;
      c = 1;
    }
    b = a;
  }
  printf("%d\n", d);
  return 0;
}
