S1 = input()
S2 = '2' + S1[0]
res = 0

if len(S1) == 1:
    print(0)

else:
    for s in S1:
        if S2[-1] == s:
            S2 += s
        else:
            S2 = S2[:-1:]
            res += 2

    print(res)
