#include <bits/stdc++.h>
using namespace std;
long tests;
string st;
long t1, timee;
long ans;
long calc;
long eval(string st) {
  long h, m;
  h = st[1] - 48;
  h = h * 10 + st[2] - 48;
  m = st[4] - 48;
  m = m * 10 + st[5] - 48;
  if (h == 12) {
    h -= 12;
  }
  if (st[7] == 'p') h += 12;
  return h * 60 + m;
}
int main() {
  ios_base::sync_with_stdio(0);
  ++ans;
  cin >> tests;
  timee = 0;
  getline(cin, st);
  for (; tests; --tests) {
    getline(cin, st);
    t1 = eval(st);
    if (t1 < timee) {
      ++ans;
      calc = 1;
    }
    if (t1 == timee) {
      ++calc;
      if (calc == 11) {
        ++ans, calc = 1;
      }
    }
    if (t1 > timee) calc = 1;
    timee = t1;
  }
  cout << ans << endl;
  cin.get();
  cin.get();
  return 0;
}
