S=io.read()
local count=0
local i=1
while i~=#S  do
    if string.sub(S,i,i)=="0" and string.sub(S,i+1,i+1)=="1" or string.sub(S,i,i)=="1" and string.sub(S,i+1,i+1)=="0" then
        count=count+2
        S=string.sub(S,1,i-1)..string.sub(S,i+2,#S)
        i=i-1
    else
        i=i+1
    end
end
print(count)
        