s = input()
n = len(s)
cnt = 0
i = 0
while 1:
    if len(s) == 0 or len(s) == 1:
        break
    while i < len(s)-1:
        if s[i] == s[i+1]:
            s = s[:i:] + s[i+2::]
            cnt += 2
            break
        i += 1
    if len(s)-1 == i:
        break
print(cnt)