s = input()
#print(type(s))
#s = str(s)
#print(type(s))
#print(s)


#s = int(s)
#s = str(s)

flag = 1
cont = 0


while(flag):
    flag = 0
    for x in range(0, len(s)):
        if  x+1 < len(s) and s[x] == '1' and s[x+1] == '0':
            cont = cont + 2
            flag = 1
            aux = s[:x]
            aux2 = s[x+2: len(s)]
            s = aux + aux2
        elif x+1 < len(s) and s[x] == '0' and s[x+1] == '1':
            cont = cont + 2
            flag = 1
            aux = s[:x]
            aux2 = s[x+2: len(s)]
            s = aux + aux2

print(cont)