#include <iostream>
#include <stdio.h>
using namespace std;
void fast_io(){
ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
#ifndef ONLINE_JUDGE
//freopen("input.txt", "r", stdin);
#endif
}
bool isLucky(int n){
while (n > 0){
if (n%10 != 7 && n%10 != 4){
return false;
}
n /= 10;
}
return true;
}
int main()
{
fast_io();
int n;
cin >> n;
string magnets[n];
int groups = 1;
for (int i = 0; i < n; i++){
cin >> magnets[i];
if (i > 0 && magnets[i-1] != magnets[i]){
groups++;
}
}
cout << groups;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKI2luY2x1ZGUgPHN0ZGlvLmg+CgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCgp2b2lkIGZhc3RfaW8oKXsKICAgIGlvc19iYXNlOjpzeW5jX3dpdGhfc3RkaW8oZmFsc2UpLCBjaW4udGllKG51bGxwdHIpLCBjb3V0LnRpZShudWxscHRyKTsKICAgICNpZm5kZWYgT05MSU5FX0pVREdFCiAgICAgICAgLy9mcmVvcGVuKCJpbnB1dC50eHQiLCAiciIsIHN0ZGluKTsKICAgICNlbmRpZgp9Cgpib29sIGlzTHVja3koaW50IG4pewogICAgd2hpbGUgKG4gPiAwKXsKICAgICAgICBpZiAobiUxMCAhPSA3ICYmIG4lMTAgIT0gNCl7CiAgICAgICAgICAgIHJldHVybiBmYWxzZTsKICAgICAgICB9CiAgICAgICAgbiAvPSAxMDsKICAgIH0KICAgIHJldHVybiB0cnVlOwp9CgppbnQgbWFpbigpCnsKICAgIGZhc3RfaW8oKTsKICAgIGludCBuOwogICAgY2luID4+IG47CiAgICBzdHJpbmcgbWFnbmV0c1tuXTsKICAgIGludCBncm91cHMgPSAxOwogICAgZm9yIChpbnQgaSA9IDA7IGkgPCBuOyBpKyspewogICAgICAgIGNpbiA+PiBtYWduZXRzW2ldOwogICAgICAgIGlmIChpID4gMCAmJiBtYWduZXRzW2ktMV0gIT0gbWFnbmV0c1tpXSl7CiAgICAgICAgICAgIGdyb3VwcysrOwogICAgICAgIH0KICAgIH0KICAgIGNvdXQgPDwgZ3JvdXBzOwp9