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

while True:
    if len(S) == 1:
        print(0)
        break
    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
    if count == count_p:
        if S == ['0', '1'] or ['1', '0']:
            count += 2
        print(count)
        break
    else:
        count_p = count
        A = []
        for i in range(len(S)):
            if S[i] != '2':
                A.append(S[i])
