S = str(input())
ans = 0
while True:
    S = S.replace("01", "R")
    S = S.replace("10", "L")
    if S.count("R") + S.count("L") > 0:
        ans +=(S.count("R") + S.count("L"))*2
        S = S.replace("R", "")
        S = S.replace("L","")
    else:
        break
print(ans)