import sys input=lambda: sys.stdin.readline().rstrip() n=int(input()) A=[int(i) for i in input().split()] ans=0 cur=0 for i,a in enumerate(A): if cur==0: ans+=1 cur=1 else: cur=0 if a==A[i-1]: ans+=1 cur=1 print(ans)