s = input()
count = 0
while True:
    if "01" in s:
        count += 2 * s.count("01")
        s = s.replace("01", "")
    elif "10" in s:
        count += 2 * s.count("10")
        s = s.replace("10", "")
    else:
        break
print(count)