S = input()
before_number = ""
counter = 0
ans = 0

while 1 == 1:
    counter1 = S.count("01")
    S = S.replace("01", "")
    ans += counter1
    counter2 = S.count("10")
    S = S.replace("10", "")
    ans += counter2
    if counter1 == 0 and counter2 == 0:
        break

print(ans*2)
