n = int(eval(input()))

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

p = 0

x = 0

y = 1



for i in range(n):

    if a[i] != x:

        if y == 1:

            x = a[i]

        else:

            p += y // 2

            x = a[i]

            y = 1

    else:

        y += 1



if y == 1:

    print(p)

else:

    print((p + y // 2))
n = int(eval(input()))

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

x = a[0]

y = 1

ans = 0

for i in range(1,n):

    if a[i] == x:

        y += 1

    else:

        ans += y // 2

        x = a[i]

        y = 1

print((ans + y // 2))
n = int(eval(input()))
a = list(map(int, input().split()))
p = 0
x = 0
y = 1
for i in range(n):
    if a[i] != x:
        if y == 1:
            x = a[i]
        else:
            p += y // 2
            x = a[i]
            y = 1
    else:
        y += 1
if y == 1:
    print(p)
else:
    print((p + y // 2))

n = int(eval(input()))
a = list(map(int, input().split()))
x = a[0]
y = 1
ans = 0
for i in range(1, n):
    if a[i] == x:
        y += 1
    else:
        ans += y // 2
        x = a[i]
        y = 1
print((ans + y // 2))

-p = 0 -x = 0 +x = a[0] -for i in range(n): -    if a[i] != x: -        if y == 1: -            x = a[i] -        else: -            p += y // 2 -            x = a[i] -            y = 1 +ans = 0 +for i in range(1, n): +    if a[i] == x: +        y += 1 -        y += 1 -if y == 1: -    print(p) -else: -    print((p + y // 2)) +        ans += y // 2 +        x = a[i] +        y = 1 +print((ans + y // 2))