S=input()
l = len(S)
S_list = [S[i] for i in range(l)]
ans =0
while True:
    l = len(S_list)
    if l<2:
        break
    check_dif = False
    for i in range(l-1):
        if S_list[i] != S_list[i+1]:
            S_list.pop(i)
            S_list.pop(i)
            check_dif = True
            break
    if check_dif:
        ans+=2
print(ans)