import sys
input = sys.stdin.readline
import re
def print_ans(S):
    """Test Case
    >>> print_ans("0011")
    4
    >>> print_ans("11011010001011")
    12
    >>> print_ans("0")
    0
    """
    flg = True
    ans = 0
    while flg:
        tmp = re.search(r"01|10", S)
        if tmp == None:
            flg = False
        else:
            S = S[:tmp.start()] + S[tmp.start() + 2:]
            ans += 2
    print(ans)
        


if __name__ == '__main__':
    S = input().rstrip()
    print_ans(S)
