#include <bits/stdc++.h>
using namespace std;
int cmp(int h0, int m0, int h1, int m1) {
  if (h0 == h1)
    if (m0 < m1)
      return -1;
    else if (m0 == m1)
      return 0;
    else
      return 1;
  else if (h0 < h1)
    return -1;
  else
    return 1;
}
int main() {
  int n, day, i, j, h[110], m[110];
  char str[80], c;
  scanf("%d", &n);
  getchar();
  day = 1;
  for (i = 0; i < n; i++) {
    scanf("[%d:%d]", &h[i], &m[i]);
    gets(str);
    if (str[1] == 'a') {
      if (h[i] == 12) h[i] = 0;
    } else {
      if (h[i] != 12) h[i] += 12;
    }
  }
  for (i = 1; i < n; i++)
    if (cmp(h[i - 1], m[i - 1], h[i], m[i]) == 1) day++;
  for (i = 0; i < n;) {
    j = i;
    while (cmp(h[j], m[j], h[j + 1], m[j + 1]) == 0 && j + 1 < n) j++;
    day += (j - i) / 10;
    i = j + 1;
  }
  cout << day << endl;
  return 0;
}
