import numpy as np

S = str(input())

r = '00'
b = '11'

count=0
i=0
while i < (len(S)-1):
    if r == S[i:i+2]:
        S = S.replace(r,'',1)
        count+=1
        i=0
    if b == S[i:i+2]:
        S = S.replace(b,'',1)
        count+=1
        i=0
    else:
        i+=1
        
print(int(2*count))