#include <bits/stdc++.h>
using namespace std;
const int N = 110;
inline int read() {
  int w = 0, r = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') r = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    w = (w << 1) + (w << 3) + (ch ^ 48);
    ch = getchar();
  }
  return w * r;
}
int n, val[N], cnt, num;
string s[N];
inline int conver(string x) { return (x[0] ^ 48) * 10 + (x[1] ^ 48); }
int main() {
  n = read();
  cnt = 1;
  for (int i = 1; i <= n; i++) {
    getline(cin, s[i]);
    int h = conver(s[i].substr(1, 2));
    int min = conver(s[i].substr(4, 2));
    if (h == 12 && s[i][7] == 'a') {
      h = 0;
    }
    if (s[i][7] == 'p') {
      if (h != 12) h += 12;
    }
    val[i] = h * 60 + min;
  }
  num = 1;
  for (int i = 2; i <= n; i++) {
    if (val[i] == val[i - 1]) {
      num++;
      if (num > 10) {
        cnt++;
        num = 1;
      }
    }
    if (val[i] < val[i - 1]) {
      cnt++;
    }
    if (val[i] != val[i - 1]) num = 1;
  }
  cout << cnt << endl;
  return 0;
}
