N=int(input()) L=list(map(int,input().split())) ans=1 F=1 for i in range(1,N): if F==1: if L[i]==L[i-1]: ans+=1 else: F=0 else: ans+=1 F=1 print(ans)