#include <bits/stdc++.h>
using namespace std;
const int inf = 1 << 30;
int n;
string s[105];
int cnt = 1;
int hour[105], mint[105];
int getnum(char x, char y) { return (x - '0') * 10 + (y - '0'); }
int main() {
  scanf("%d", &n);
  getline(cin, s[103]);
  for (int i = 0; i < n; i++) {
    getline(cin, s[i]);
    hour[i] = getnum(s[i][1], s[i][2]);
    mint[i] = getnum(s[i][4], s[i][5]);
    if (hour[i] == 12 && s[i][7] == 'a')
      s[i][7] = 'p';
    else if (hour[i] == 12 && s[i][7] == 'p')
      s[i][7] = 'a';
    if (s[i][7] == 'p') hour[i] += 12;
    if (hour[i] == 24) hour[i] = 0;
  }
  int ans = 1;
  for (int i = 1; i < n; i++) {
    if (hour[i] != hour[i - 1] || mint[i] != mint[i - 1])
      cnt = 1;
    else
      cnt++;
    if (cnt == 11) {
      ans++;
      cnt = 1;
    }
    if (hour[i] < hour[i - 1] ||
        hour[i - 1] == hour[i] && mint[i] < mint[i - 1])
      ans++;
  }
  cout << ans << endl;
  return 0;
}
