#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  cin.ignore();
  vector<pair<int, int> > v;
  while (t--) {
    string str;
    getline(cin, str);
    bool flag = false;
    if (str[7] == 'a') flag = true;
    string x = str.substr(1, 2);
    string y = str.substr(4, 2);
    stringstream iss(x);
    stringstream is(y);
    int h, m;
    while (iss >> h) {
    }
    while (is >> m) {
    }
    if (h == 12 && flag)
      h = 0;
    else if (h == 12 && !flag)
      h = 12;
    else if (!flag)
      h += 12;
    v.push_back({h, m});
  }
  int d, cnt;
  for (int i = 0; i < v.size(); i++) {
    if (i == 0) {
      cnt = 1;
      d = 1;
    } else {
      if (v[i].first == v[i - 1].first && v[i].second == v[i - 1].second &&
          cnt < 10) {
        cnt++;
      } else if (v[i].first == v[i - 1].first &&
                 v[i].second == v[i - 1].second && cnt == 10) {
        cnt = 1;
        d++;
      } else if ((v[i].first > v[i - 1].first) ||
                 (v[i].first == v[i - 1].first &&
                  v[i].second > v[i - 1].second)) {
        cnt = 1;
      } else if ((v[i].first < v[i - 1].first) ||
                 (v[i].first == v[i - 1].first &&
                  v[i].second < v[i - 1].second)) {
        cnt = 1;
        d++;
      }
    }
  }
  cout << d << endl;
  return 0;
}
