S = input()
len_org = len(S)
while True:
    len_before = len(S)
    S.replace("10","").replace("01","")
    len_after = len(S)
    if len_before == len_after:
        break

print(len_org - len_after)