from sys import stdin

tokens = stdin.read().split()
n = int(tokens[0])
islands = 0
old_type = ""
for island in tokens[1:n + 1]:
	if island != old_type:
		islands += 1
		old_type = island

print islands