S = input()
cnt = 0
while True:
    flg = True
    for i in range(len(S)-1):
        if S[i] != S[i+1]:
            S = S[:i] + S[i+2:]
            flg = False
            cnt += 1
            break
    
    if flg:
        break

print(cnt*2)