S = list(input())
S = list(map(int, S))

cnt = 0
renew=True
while S and renew:
    nextS = []
    renew = False
    lS = len(S)
    i = 0
    while (i <= lS-1):
        if i == lS-1:
            nextS.append(S[i])
            break
        a = S[i]
        b = S[i+1]
        if a != b:
            cnt += 1
            i+=2
            renew = True
        else:
            nextS.append(a)
            i+=1
    S = nextS
print(cnt*2)