s = list(input())
n = len(s)

cnt = 0
l = 0

while l < n-1:
    if ( s[l] == '0' ) and ( s[l+1] == '1' ):
        cnt += 2
        s[l:l+1]=[]
        n = len(s)
        l -= 1
        continue
    l += 1

print(cnt)
