S=list(input())
ans=0
for i in range(10):
    for j in range(len(S)-1):
        if j<len(S)-1:
            if S[j]!=S[j+1]:
                S.pop(j)
                S.pop(j)
                ans+=2
        else:
            break
print(ans)
