#include <bits/stdc++.h>
using namespace std;
int n;
int a[10240];
char s[1024000];
int main() {
  cin >> n;
  for (int i = 0; i <= n; i++) {
    int hh, mm;
    char cc;
    scanf("[%d:%d %c.m.]: ", &hh, &mm, &cc);
    if (i != 0) {
      if (hh == 12) hh = 0;
      if (cc == 'p') hh += 12;
      a[i] = hh * 60 + mm;
    }
    gets(s);
  }
  int ans = 1;
  int x = a[1];
  int cnt = 1;
  for (int i = 2; i <= n; i++) {
    if (a[i] > x) {
      x = a[i];
      cnt = 1;
    } else if (a[i] == x) {
      cnt++;
      if (cnt > 10) {
        ans++;
        cnt -= 10;
      }
    } else {
      x = a[i];
      cnt = 1;
      ans++;
    }
  }
  cout << ans << "\n";
  return 0;
}
