s = input()
change_s = "" + s
check = True
while check:
    change_s = change_s.replace("01", "")
    change_s = change_s.replace("10", "")
    check = "01" in change_s or "10" in change_s
print(len(s) - len(change_s))