N = int(input()) A = list(map(int, input().split())) i = 0 n = 0 while i < N-1: if A[i] != A[i+1]: n += 1 else: i += 1 i += 1