#include <bits/stdc++.h>
int mat[110];
char a[10005];
int hh, mm;
char fus;
int main() {
  int i, j, n, cont = 1, pas = 1;
  scanf("%d", &n);
  scanf("\n");
  for (i = 1; i <= n; ++i) {
    hh = 0;
    mm = 0;
    fgets(a, 10005, stdin);
    hh = (hh + (a[1] - '0')) * 10 + (a[2] - '0');
    mm = (mm + (a[4] - '0')) * 10 + (a[5] - '0');
    if (a[7] == 'a' && hh == 12) hh = 0;
    if (a[7] == 'p' && hh == 12) hh = 12;
    if (a[7] == 'p' && hh != 12) hh += 12;
    mat[i] = (mat[i] + hh) * 100 + mm;
  }
  for (i = 1; i <= n; ++i) {
    if (mat[i] == mat[i + 1]) {
      pas = 1;
      for (j = i + 1; j <= n; ++j) {
        if (mat[j] == mat[j + 1])
          ++pas;
        else {
          i = j;
          break;
        }
      }
      cont += pas / 10;
    }
    if (mat[i] > mat[i + 1] && i + 1 <= n) ++cont;
  }
  printf("%d", cont);
}
