S = input()
ans = 0

N = len(S)
Slist = []

for i in range(N):
    Slist.append(S[i])

def f(A, ans):
    n = len(A)
    if n == 0 or n == 1:
        print(ans)
        return 0
        
    for j in range(n-1):
        if A[j] == '0' and A[j+1] == '1':
            del A[j:j+2]
            ans += 2
            break
        elif A[j] == '1' and A[j+1] == '0':
            del A[j:j+2]
            ans += 2
            break
        if j == n-2:
            print(ans)
            return 0 
    f(A, ans)

f(Slist, ans)

        