S = input()

work = S
unfinished = True
cnt = 0
lenlog = 0

while unfinished:
    work = work.replace('01', '').replace('10', '')
    cnt = len(S) - len(work)

    if lenlog == len(work):
        unfinished = False
        print(cnt)
        quit()

    lenlog = len(work)