#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int N;
  int ans = 0;
  cin >> N;
  int ls = 1e8, cnt = 0;
  string s;
  getline(cin, s);
  for (int i = 0; i < N; i++) {
    string s;
    getline(cin, s);
    int h = stoi(s.substr(1, 2));
    int m = stoi(s.substr(4, 2));
    if (s[7] == 'p') {
      h += 12;
    }
    if (h == 12) {
      h = 0;
    }
    if (h == 24) {
      h = 12;
    }
    int cur = h * 60 + m;
    if (cur == ls) {
      cnt++;
    } else {
      cnt = 1;
    }
    if (cnt > 10 || cur < ls) {
      ans++;
      cnt = 1;
    }
    ls = cur;
  }
  cout << ans;
  return 0;
}
