s = input()
count = 0
while True:
    N = len(s)
    for n in range(N-1):
        if s[n] != s[n+1]:
            s = s[:n] + s[n+2:]
            count += 2
            break
    else:
        break
print(count)