l=list(input())
count=0
while True:
    flag=True
    for i in range(len(l)-1):
        if l[i]!=l[i+1]:
            l.pop(i)
            l.pop(i)
            flag=False
            count+=2
            break
    if flag:
        print(count)
        break
