N = int(eval(input()))

src = list(map(int,input().split()))



prev = -1

seq = 1

ans = 0

for a in src:

    if prev == a:

        seq += 1

    else:

        ans += seq//2

        seq = 1

    prev = a



if seq > 1:

    ans += seq//2

print(ans)
N = int(eval(input()))

A = list(map(int,input().split()))



ans = 0

changed = False

for a,b in zip(A,A[1:]):

    if changed:

        changed = False

        continue

    if a == b:

        ans += 1

        changed = True

print(ans)
N = int(eval(input()))
src = list(map(int, input().split()))
prev = -1
seq = 1
ans = 0
for a in src:
    if prev == a:
        seq += 1
    else:
        ans += seq // 2
        seq = 1
    prev = a
if seq > 1:
    ans += seq // 2
print(ans)

N = int(eval(input()))
A = list(map(int, input().split()))
ans = 0
changed = False
for a, b in zip(A, A[1:]):
    if changed:
        changed = False
        continue
    if a == b:
        ans += 1
        changed = True
print(ans)

-src = list(map(int, input().split())) -prev = -1 -seq = 1 +A = list(map(int, input().split())) -for a in src: -    if prev == a: -        seq += 1 -    else: -        ans += seq // 2 -        seq = 1 -    prev = a -if seq > 1: -    ans += seq // 2 +changed = False +for a, b in zip(A, A[1:]): +    if changed: +        changed = False +        continue +    if a == b: +        ans += 1 +        changed = True