#include <bits/stdc++.h>
using namespace std;
struct node {
  int h, m;
  int hehe;
} a[110];
int n;
char s[10000];
int main() {
  int i, j;
  cin >> n;
  ;
  getchar();
  for (i = 1; i <= n; i++) {
    gets(s);
    a[i].h = (s[1] - '0') * 10 + s[2] - '0';
    a[i].m = (s[4] - '0') * 10 + s[5] - '0';
    if (a[i].h == 12) a[i].h = 0;
    if (s[7] == 'p') {
      a[i].h += 12;
    }
    a[i].hehe = a[i].m + a[i].h * 60;
  }
  int ans = 1, x = a[1].hehe;
  int siz = 1;
  for (i = 2; i <= n; i++) {
    if (a[i].hehe < x)
      siz = 1, ans++;
    else if (a[i].hehe == x)
      siz++;
    else
      siz = 1;
    if (siz > 10) {
      siz = 1;
      ans++;
    }
    x = a[i].hehe;
  }
  printf("%d\n", ans);
  return 0;
}
