#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int i;
  int timed;
  int ans = 1;
  int total = 0;
  cin >> n;
  cin.ignore();
  for (i = 0; i < n; i++) {
    char str[100];
    gets(str);
    int h = (str[1] - '0') * 10 + (str[2] - '0');
    int m = (str[4] - '0') * 10 + (str[5] - '0');
    h %= 12;
    if (str[7] == 'p') h += 12;
    int time = h * 60 + m;
    if (!i) {
      timed = time;
    } else {
      if (time == timed) {
        total++;
        if (total >= 10) {
          ans++;
          total = 0;
        }
      } else {
        total = 0;
        if (timed > time) ans++;
        timed = time;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
