#yukicoder 921 ずんだアロー N = int(input()) A = list(map(int,input().split())) flg = 1 ans = 1 for i in range(1,N): if flg: if A[i-1] == A[i]: ans += 1 else: flg = 0 else: ans += 1 flg = 1 print(ans)