#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  getline(cin, s);
  int l = -1, c = 0, d = 1;
  for (int i = 0; i < n; i++) {
    getline(cin, s);
    int h = (s[1] - '0') * 10 + s[2] - '0';
    if (h == 12) h = 0;
    if (s[7] == 'p') h += 12;
    h = h * 60 + (s[4] - '0') * 10 + s[5] - '0';
    if (h < l) d++;
    if (h == l)
      c++;
    else {
      l = h;
      c = 1;
    }
    if (c == 11) {
      d++;
      c = 1;
    }
  }
  cout << d << endl;
}
