
s = list(input())

k = len(s)
i = 0
j = 0

for t in range(k):
    if i+1 >= k-j or len(s)==1:
        break
    elif s[i] + s[i+1] =='01' or s[i] + s[i+1] =='10':
        del s[i]
        del s[i]
        i = 0
        j = j + 2
    else:
        i = i+1

print(j)
