n = int(input()) A = list(map(int, input().split())) e = 0 for i in range(n): if i%2 == 0: e += 1 else: if i != n-1: if A[i-1] == A[i] and A[i] == A[i+1]: e += 1 else: if A[i-1] == A[i]: e += 1 o = 0 for i in range(n): if i%2 == 1: o += 1 else: if i == 0: if A[i] == A[i+1]: o += 1 if i != n-1: if A[i-1] == A[i] and A[i] == A[i+1]: o += 1 else: if A[i-1] == A[i]: o += 1 print(max(o, e))