import copy

s = str(input())
s_origin = copy.copy(s)

while len(s) > 0:
    if "10" in s:
        s = str(s).replace("10","")
    elif "01" in s:
        s = str(s).replace("01","")
    else:
        break

print(int(len(s_origin) - len(s)))