#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 29;
const double PI = acos(-1);
const double EPS = 1e-8;
int main() {
  int n;
  cin >> n;
  cin.ignore();
  int pre = -1;
  int cnt = 0;
  int ans = 1;
  for (int i = 0; i < (int)n; ++i) {
    string line;
    getline(cin, line);
    int h = atoi(line.substr(1, 2).c_str());
    int m = atoi(line.substr(4, 2).c_str());
    char c = line[7];
    h %= 12;
    if (c == 'p') h += 12;
    int t = h * 60 + m;
    if (t < pre) {
      ans++;
      cnt = 0;
    } else if (t == pre) {
      cnt++;
      if (cnt == 10) {
        ans++;
        cnt = 0;
      }
    } else {
      cnt = 0;
    }
    pre = t;
  }
  cout << ans << endl;
}
