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

count = 0

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