N = input()

ans = 0
while(True):
    changeFlg = False
    for a in range(len(N)-1):
        if N[a] != N[a + 1]:
            N = N[0:a] + N[a+2 : len(N)]
            ans += 2
            changeFlg = True
            break
    if  changeFlg == False:
        break

print(ans)