S = list(input())

left = [S.pop(0)]
ans = 0
if not S:
    print(ans)

i = 0
while i < len(S):
    if not left:
        left.append(S[i])
        i += 1
    else:
        if left[-1] + S[i] in ['01', '10']:
            left.pop()
            ans += 1
            i += 1
        else:
            left.append(S[i])
            i += 1
print(2*ans)
    