S = input()
total = 0
while True:
    count_10 = S.count("10")
    total += count_10 * 2
    S = S.replace("10", "")
    count_01 = S.count("01")
    total += count_01 * 2
    S = S.replace("01", "")
    if count_01 == 0 and count_10 == 0:
        break
print(total)