S = input()
N = len(S)
cnt = 0
used = [0] * N
l , r = -1,-1
while True:
    flg = False
    for i in range(N):
        if used[i] == 0:
            if l == -1:
                l = i
            else:
                r = i
                if S[l] != S[r]:
                    used[l] = 1
                    used[r] = 1
                    l,r = -1,-1
                    flg = True
                    cnt += 1
                else:
                    l = r
    if not flg:
        break

print(cnt*2)