#include <bits/stdc++.h>
using namespace std;
const int N = 1e4 + 7;
int n;
int read() {
  char str[20], ch;
  while ((ch = getchar()) != '[')
    ;
  int hh, mm;
  scanf("%d:%d %s", &hh, &mm, str);
  if (hh == 12) hh = 0;
  if (str[0] == 'p') hh += 12;
  return hh * 60 + mm;
};
int dig[N];
int main() {
  scanf("%d\n", &n);
  for (int i = (0); i < (n); i++) dig[i] = read();
  int ans = 1, siz = 0, pre = -1;
  for (int i = (0); i < (n); i++) {
    if (dig[i] < pre) {
      siz = 1;
      ans++;
    } else if (dig[i] == pre)
      siz++;
    else
      siz = 1;
    if (siz == 11) ans++, siz = 1;
    pre = dig[i];
  }
  printf("%d", ans);
  return 0;
}
