import std.stdio;
import core.stdc.stdio;

void main() {
    uint n, r = 1;
    scanf(`%u`, &n);

    uint l = 3;

	foreach(i; 0..n) {
		uint k;
		scanf(`%u`, &k);

		uint a = k / 10;
		uint b = k % 10;

		if(l == a) r++;
		l = b;
	}

	write(r);
}
