

s1 = input()
len_s = len(s1)
s2 = s1
while True:
    len_1 = len(s2)
    s2 = s2.replace("01", "").replace("10", "")
    len_2 = len(s2)
    if len_1 == len_2:
        break


print(len_s - len(s2))
