N = int(input()) A = map(int, input().split()) n = 0 for i in N-1: if i != N[i+1]: n += 1 print(n)