N = int(input()) A = list(map(int,input().split())) ans = 0 back = False for i in range(N): if back == False or A[i]==A[i-1]: ans+=1 back = True else: back = False print(ans)