s = input()

count = 0
removed = True
while removed:
    removed = False
    for i in range(1, len(s)):
        if s[i-1] != s[i]:
            s = s[0:i-1] + s[i+1:]
            removed = True
            count += 2
            break
print(count)
