
s = input()
count = 0

for i in range(1000):
    if not(("01" in s) | ("10" in s)):
        break
    if "01" in s:
        #count += 2 * s.count("01")
        s = s.replace("01", "", 1)
        count += 2
    else :
        #count += 2 * s.count("10")
        s = s.replace("10", "", 1)
        count += 2

print(count)
