S=raw_input()
A=[S[0]]
Ans=0
for i in range(len(S)):
    if len(A)>0:
        if A[-1]!=S[i]:
            A=[a for a in A[:-1]]
            Ans+=2
        else:
            A.append(S[i])
    else:
        A.append(S[i])

print Ans