s = input()
s = list(s)
count = 0
for j in range(10):
    for i in range(len(s)):
        try:
            if s[i] != s[i+1]:
                s.pop(i)
                s.pop(i)
                count = count+1
        except IndexError:
            pass
print(count*2)
