eval(input())

cnt=0

now=0

res=0

for a in map(int,input().split()):

    if a==now:

        cnt+=1

    else:

        res+=cnt//2

        cnt=1

    now=a

print((res+cnt//2))
eval(input())

ans=x=0

for a in input().split():

    ans+=a==x

    x=a*(a!=x)

print(ans)
eval(input())
cnt = 0
now = 0
res = 0
for a in map(int, input().split()):
    if a == now:
        cnt += 1
    else:
        res += cnt // 2
        cnt = 1
    now = a
print((res + cnt // 2))

eval(input())
ans = x = 0
for a in input().split():
    ans += a == x
    x = a * (a != x)
print(ans)

-cnt = 0 -now = 0 -res = 0 -for a in map(int, input().split()): -    if a == now: -        cnt += 1 -    else: -        res += cnt // 2 -        cnt = 1 -    now = a -print((res + cnt // 2)) +ans = x = 0 +for a in input().split(): +    ans += a == x +    x = a * (a != x) +print(ans)