S = input()

def delete_cube(cube):
    new_cube = []
    cnt = 0
    i=0
    while(i < len(cube)):
        if i == len(cube)-1:
            new_cube.append(cube[i])
            i+=1
        elif (cube[i]=='0' and cube[i+1]=='1') or (cube[i]=='1' and cube[i+1]=='0'):
            cnt+=2
            i+=2
        else:
            new_cube.append(cube[i])
            i+=1
    return(new_cube, cnt)

total_cnt=0
while(True):
    S,cnt = delete_cube(S)
    if cnt==0:
        break
    total_cnt+=cnt
print(total_cnt)
