s = list(input())
l = len(s)
i = 0
while True:
    if len(s)-1 <= i:
        break
    if s[i] == '0' and s[i+1] == '1' or s[i] == '1' and s[i+1] == '0':
        del s[i:i+2]
        i = 0
    else:
        i += 1

print(l-len(s))
