s=list(input())
for i in range(0,len(s)):
    s[i]=int(s[i])
    
adj=-1
op=0
while(adj==-1):
    adj=0
    for i in range(1,len(s)):
        if((s[i]==0 and s[i-1]==1) or (s[i]==1 and s[i-1]==0)):
            adj=-1
            s[i]=2
            s[i-1]=2
            op+=2
    while True:
        try:
            s.remove(2)
        except:
            break
            
print(op)
