s = input()
ans = 0

while True:
    ans += s.count("01")*2
    s = s.replace("01", "")
    ans += s.count("10")*2
    s = s.replace("10", "")
    if not (s.count("01") or s.count("10")):
        break

print(ans)