def check(P):
    for i in range(len(P)-1):
        if P[i] != P[i+1]:
            return i
    return "Non"
P = list(input())
t = check(P)
pop = 0
while t != "Non":
    P.pop(t)
    P.pop(t)
    pop+=1
    t = check(P)
print(pop*2)
