#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int a = 0, f = 1;
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') f = -1;
  for (; isdigit(ch); ch = getchar()) a = (a << 3) + (a << 1) + ch - '0';
  return a * f;
}
const int mod = 1e9 + 7;
const int N = 1e6 + 5;
int ans = 1, flag;
int a, b, la, lb, num;
inline void getin(void) {
  int a = read() % 12, b = read();
  char ch = getchar();
  if (ch == 'p') a += 12;
  if (a < la || (a == la && b < lb)) ans++;
  if (a == la && b == lb)
    num++;
  else
    num = 1;
  if (num > 10) ans++, num = 1;
  la = a, lb = b;
}
signed main() {
  for (int t = read(); t; t--) getin();
  printf("%d\n", ans);
  return 0;
}
