import copy

S = input()
cube = list(S)
cube_temp = copy.copy(cube)
while(1):
    for i in range(1, len(cube)):
        if (cube[i-1] == '1' and cube[i] == '0') or (cube[i-1] == '0' and cube[i] == '1'):
            cube_temp.pop(i-1)
            cube_temp.pop(i-1)
            break
    if cube == cube_temp:
        break
    else:
        cube = copy.copy(cube_temp)
print(len(S) - len(cube))
