import sys

def main():
    S  = list(map(int, input()))

    del_cnt = 0
    while True:
        now_S = len(S)
        for i in range(now_S - 1):
            if S[i] != S[i+1]:
                del S[i:i+2]
                del_cnt += 1
                break
        done_S = len(S)

        if now_S == done_S:
            break

    print(del_cnt * 2)

main()