#include <bits/stdc++.h>
using namespace std;
struct Node {
  int h, m;
} node[105];
int n, limit;
void input() {
  char mes[50];
  for (int i = 0; i < n; i++) {
    gets(mes);
    node[i].h = (mes[1] - '0') * 10 + mes[2] - '0';
    if (node[i].h == 12) node[i].h = 0;
    node[i].m = (mes[4] - '0') * 10 + mes[5] - '0';
    if (node[i].m == 60) node[i].m = 0;
    if (mes[7] == 'p') node[i].h += 12;
  }
}
bool cmp(int x) {
  if (node[x].h < node[x + 1].h ||
      (node[x].h == node[x + 1].h && node[x].m < node[x + 1].m)) {
    limit = 1;
    return false;
  } else if (node[x].h == node[x + 1].h && node[x].m == node[x + 1].m) {
    limit++;
    if (limit == 11) {
      limit = 1;
      return true;
    }
    return false;
  }
  limit = 1;
  return true;
}
int cal() {
  int cnt = 1;
  for (int i = 0; i < n - 1; i++) {
    if (cmp(i)) {
      cnt++;
    }
  }
  return cnt;
}
int main() {
  scanf("%d", &n);
  getchar();
  limit = 1;
  input();
  printf("%d\n", cal());
  return 0;
}
