#include <bits/stdc++.h>
using namespace std;
struct Time {
  bool is_pm;
  int Hour;
  int Mini;
  int cnt;
  bool operator<(const Time &A) const {
    return is_pm < A.is_pm or
           (is_pm == A.is_pm and
            (Hour < A.Hour or (Hour == A.Hour and (Mini < A.Mini))));
  }
  bool operator==(const Time &A) const {
    return is_pm == A.is_pm and Hour == A.Hour and Mini == A.Mini;
  }
  Time() {}
  Time(bool Pm, int H, int M) {
    is_pm = Pm;
    Hour = H;
    Mini = M;
    cnt = 0;
  }
};
vector<Time> run;
int n;
char s[1005];
map<Time, int> Find;
void Init() {
  scanf("%d\n", &n);
  while (n--) {
    gets(s);
    int getHour = ((s[1] - '0') * 10) + (s[2] - '0');
    int getMin = ((s[4] - '0') * 10) + (s[5] - '0');
    bool getPm = s[7] == 'p';
    if (getHour == 12) getHour = 0;
    Time A = Time(getPm, getHour, getMin);
    if (not run.empty() and A == run[run.size() - 1]) {
      run[run.size() - 1].cnt++;
    } else {
      run.push_back(A);
    }
  }
}
void Solve() {
  int Day = 1;
  for (int i = 1; i < run.size(); i++) {
    if (run[i] < run[i - 1]) Day++;
  }
  for (int i = 0; i < run.size(); i++) {
    Day += (run[i].cnt) / 10;
  }
  printf("%d\n", Day);
}
int main() {
  Init();
  Solve();
  return 0;
}
