#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:102400000,102400000")
int n;
char a[105][105];
int b[105], c[105];
int main() {
  while (scanf("%d", &n) != EOF) {
    getchar();
    for (int i = 0; i < n; i++) {
      gets(a[i]);
    }
    for (int i = 0; i < n; i++) {
      int ans = 0;
      ans *= 10;
      ans += (a[i][1] - '0');
      ans *= 10;
      ans += (a[i][2] - '0');
      ans *= 10;
      ans += (a[i][4] - '0');
      ans *= 10;
      ans += (a[i][5] - '0');
      b[i] = ans;
      if (a[i][7] == 'a')
        c[i] = 0;
      else
        c[i] = 1;
      if (b[i] >= 1200) {
        b[i] -= 1200;
      }
    }
    int ans = 1;
    int flag = 1;
    for (int i = 1; i < n; i++) {
      if (b[i] == b[i - 1] && c[i] == c[i - 1]) {
        if (flag < 10)
          flag++;
        else {
          flag = 1;
          ans++;
        }
      } else if (b[i] > b[i - 1] && c[i] >= c[i - 1] || c[i] > c[i - 1]) {
        flag = 1;
      } else {
        ans++;
        flag = 1;
      }
    }
    cout << ans << endl;
  }
  return 0;
}
