S=input()
ans=0
while 1:
    flg=True
    for i in range(len(S)-1):
        if S[i]!=S[i+1]:
            ans+=1
            S=S[:i]+S[i+2:]
            flg=False
            break
    if flg:
        break
print(ans*2)