#include <bits/stdc++.h>
using namespace std;
const int INF = 999999999 + 1;
int a[100];
char s[100];
int main() {
  int n;
  cin >> n;
  gets(s);
  for (int i = 0; i < n; i++) {
    gets(s);
    int h = (s[1] - '0') * 10 + (s[2] - '0');
    int m = (s[4] - '0') * 10 + (s[5] - '0');
    if (s[7] == 'p' && h != 12) h += 12;
    if (h == 12 && s[7] == 'a') h = 0;
    a[i] = h * 60 + m;
  }
  int ans = 1, k = 1;
  for (int i = 1; i < n; i++)
    if (a[i] < a[i - 1]) {
      ans++;
      k = 1;
    } else {
      if (a[i] == a[i - 1] && k <= 10) k++;
      if (a[i] > a[i - 1]) k = 1;
      if (a[i] == a[i - 1] && k > 10) {
        ans++;
        k = 1;
      }
    }
  cout << ans << endl;
  return 0;
}
