s = [i for i in str(input())]

count = 0

while True:
        if len(s) != 0 and sum([int(i) for i in s]) != 0 and sum([int(i) for i in s]) != len(s):
                for i in range(int(len(s))):
                        if s[i] != s[i+1]:
                                s.pop(i)
                                s.pop(i)
                                count += 2
                                break
        else:
                print(count)
                break
