S = input()
n = c = 0
while True:
    S = S.replace("01","2")
    S = S.replace("10","2")
    n += S.count("2")
    S = S.replace("2","")

    if c == n:
        break
    else:
        c = n
print(n*2)