# from sys import stdin
# S = stdin.readline().rstrip().split()
S = input()
S = list(S)
# print(S)
count_p = 0
count = 0

mark = 1
if len(S) <= 1:
    print(0)
    mark = 0
while mark:
    i = 0
    while i < len(S)-1:
        if S[i] == '0' and S[i+1] == '1':
            S[i] = '2'
            S[i+1] = '2'
            count += 2
            i += 2
        elif S[i] == '1' and S[i+1] == '0':
            S[i] = '2'
            S[i+1] = '2'
            count += 2
            i += 2
        else:
            i += 1
        # print(S)
    if count == count_p:
        print(count)
        break
    else:
        count_p = count
        A = []
        for i in range(len(S)):
            if S[i] != '2':
                A.append(S[i])
        S = A
        # print(S)
        # if len(S) == 2:
        #     if S[0] == '0'
        #      and (S == ['0', '1'] or ['1', '0']):
        #     count += 2
        #     print(count)
        #     break
