s = list(input())
n = len(s)

map_list = [int(i) for i in s]
ans=0
while True:
    flag=True
    for i in range(n-1):
        if map_list[i]==-1:
            continue
        j=i+1
        if map_list[i+1]==-1:
            for k in range(i+1,n):
                if map_list[k]!=-1:
                    j=k
                    break
        if min(map_list[i],map_list[j])>=0:
            if map_list[i]!=map_list[j]:
                map_list[i]=-1
                map_list[j]=-1
                flag=False
                ans+=2
                continue
    if flag:
        break
print(ans)


