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

while True:
    if s.find("01") != -1:
        index = s.find("01")
        s = s[:index] + s[index+1:]
        count += 2
    elif s.find("10") != -1:
        index = s.find("10")
        s = s[:index] + s[index+1:]
        count += 2
    else:
        break

print(count)
