#include <bits/stdc++.h>
using namespace std;
void setPar(string s, int &h, int &m, bool &time) {
  h = (s[1] - 48) * 10 + s[2] - 48;
  m = (s[4] - 48) * 10 + s[5] - 48;
  if (s[7] == 'a')
    time = true;
  else
    time = false;
  if (h == 12) h = 0;
}
void convert(int h[], bool time[], int n) {
  for (int i = 0; i < n; i++) {
    if (!time[i])
      h[i] += 12;
    else if (h[i] == 12 && time[i])
      h[i] = 0;
  }
}
int main() {
  int n;
  cin >> n;
  string s[110];
  getline(cin, s[0]);
  int h[110], m[110];
  bool time[110];
  for (int i = 0; i < n; i++) {
    getline(cin, s[i]);
    setPar(s[i], h[i], m[i], time[i]);
  }
  convert(h, time, n);
  int t = 1;
  int days = 1;
  for (int i = 1; i < n; i++) {
    if (h[i] == h[i - 1] && m[i] == m[i - 1])
      t++;
    else
      t = 1;
    if (h[i] < h[i - 1] || (h[i] == h[i - 1] && m[i] < m[i - 1]) || t == 11) {
      days++;
      t = 1;
    }
  }
  cout << days << endl;
  return 0;
}
