n=int(input()) a=[int(i) for i in input().split()] now=True cnt=1 for i in range(1,n): if now and a[i]==a[i-1] or not now: now=True cnt+=1 else: now=False print(cnt)