#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int t = 1;
  int ans = 1;
  int n;
  string bef, F;
  cin >> n >> bef;
  if (bef[1] == '1' && bef[2] == '2') bef[1] = bef[2] = '0';
  char c;
  cin >> c;
  int now;
  if (c == 'a')
    now = 1;
  else
    now = 2;
  getline(cin, F);
  while (--n) {
    cerr << "ok" << endl;
    string s;
    cin >> s;
    cin >> c;
    if (s[1] == '1' && s[2] == '2') {
      s[1] = s[2] = '0';
    }
    getline(cin, F);
    if (c == 'a') {
      if (now == 1) {
        if (s < bef) {
          ans++;
          t = 1;
        } else if (s == bef)
          t++;
        else
          t = 1;
      } else {
        t = 1;
        ans++;
      }
      if (t > 10) ans++, t = 1;
      now = 1;
      bef = s;
    } else {
      if (now == 1) {
        t = 1;
      } else {
        if (s < bef) {
          ans++;
          t = 1;
        } else if (s == bef)
          t++;
        else
          t = 1;
      }
      if (t > 10) ans++, t = 1;
      now = 2;
      bef = s;
    }
  }
  cout << ans << endl;
  return 0;
}
