s = input()
s2 = s
while True:
    if "01" in s2:
        s2 = s2.replace("01", "")
    elif "10" in s2:
        s2 = s2.replace("10", "")
    elif not "01" in s2 and not "10"in s2:
        break

print(len(s) - len(s2))