if __name__ == '__main__':
    S = input()
    c = 0
    while(1):
        a = 2 * S.count('01')
        if a > 0:
            S = S.replace("01", "")
        b = 2 * S.count('10')
        if b > 0:
            S = S.replace("10", "")
        num = a+b
        if num == 0:
            print(c)
            exit()
        c += num