import sys
def input(): return sys.stdin.readline().rstrip()

def main():
    S = input()
    ini_len = len(S)

    ind0 = 1
    ind1 = 1
    while ind0 >= 0 or ind1 >= 0:
        ind0 = S.find('01')
        if ind0 >= 0:
            S = S.replace('01', '')
        ind1 = S.find('10')
        if ind1 >= 0:
            S = S.replace('10', '')
    print(ini_len - len(S))

if __name__ == '__main__':
    main()
