import re

S = input()

trimmed = 0

while True:
    tmp = re.split("01|10", S)
    if len(tmp) == 1:
        break
    else:
        trimmed = trimmed + len(tmp) - 1
        S = "".join(tmp)

print(trimmed * 2)
