s = input()
ans = len(s)
cube = s
hight = len(s)
while True:
    cube = cube.replace('01','').replace('10','')
    if hight == len(cube):
        ans -= len(cube)
        break
    else:
        hight = len(cube)
print(ans)