s = list(map(int, list(input())))
ls = len(s)
while True:
    f = False
    for i in range(len(s)-1):
        if (s[i] ==0 and s[i+1] ==1) or (s[i] ==1 and s[i+1] ==0):
            s[i], s[i+1] = '', ''
            f = True
    while '' in s:
        s.remove('')
    if f == False:
        break
print(ls-len(s))