s = input()
count = 0

for i in range(1000):
    if not(("01" in s) | ("10" in s)):
        break
    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", "")

print(count)
