#include <bits/stdc++.h>
using namespace std;
char str[105];
int main() {
  int g;
  cin >> g;
  gets(str);
  int n = 0, m = -1, c = 1, ans = 1;
  for (int i = 0; i < g; i++) {
    gets(str);
    int tn = 10 * (str[1] - '0') + str[2] - '0';
    int tm = 10 * (str[4] - '0') + str[5] - '0';
    if (tn == 12) tn = 0;
    if (str[7] == 'p') tn += 12;
    if (tn < n || (tn == n && tm < m)) ans++;
    if (tn == n && tm == m)
      c++;
    else
      c = 1;
    if (c == 11) {
      c = 1;
      ans++;
    }
    n = tn;
    m = tm;
  }
  cout << ans;
  return 0;
}
