s = input()
n = len(s)
ans = 0
i = 1

while i < n:
    if s[i-1] == "0" and s[i] == "1":
        s = s[:i-1] + s[i+1:]
        n -= 2
        ans += 2
        i = 1
        if n == 0 or n == 1:
            print(ans)
            exit()
        continue
    elif s[i-1] == "1" and s[i] == "0":
        s = s[:i-1] + s[i+1:]
        n -= 2
        ans += 2
        i = 1
        if n == 0 or n == 1:
            print(ans)
            exit()
        continue
    else:
        i += 1
        
print(ans)