n = int(input()) a = list(map(int, input().split())) cnt = 0 for i in range(n-1): if n==1: cnt=1 break else: if a[i]-a[i+1]!=0: cnt+=1 print(cnt)