N = int(input()) A = list(map(int, input().split())) ans = 1 flag = True for i in range(1, N): if A[i] != A[i-1]: if flag: flag = False else: ans += 1 flag = True else: ans += 1 flag = True print(ans)