#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;
}