s=list(map(int,input()))
i=0
ans=0
a=s[i]
b=s[i]

while True:
    try:
        #print(s)
        i=i+1
        #print(i)
        a=s[i]
        if a!=b:
            del s[i-1]
            del s[i-1]
            ans=ans+2
            #print(ans)
            i=i-2
            a=s[i]
        b=a
    except:
        break
print(ans)