s = list(map(int , input()))
n = len(s)
i = 0
while True:
    try:
        if s[i] + s[i+1] == 1:
            del s[i]
            del s[i]
            i = 0
        else:
            i += 1
    except:
        break
print(n - len(s))