import sys
input = sys.stdin.readline
s = input()
count = 0

for _ in range(1000000):
    if s.count("01") != 0:
        num = s.count("01")
        s = s.replace("01", "")
        count += 2*num
    elif s.count("10") != 0:
        num = s.count("10")
        s = s.replace("10", "")
        count += 2*num
    else:
        break

print(count)
