# This file is a "Hello, world!" in Python language by CPython for wandbox.

def checkeof(s):
    l = len(s)
    #print("1"*l)
    #print("0"*l)
    if l == 0:
        return False
    if "1"*l == s or "0"*l == s:
        return False
    else:
        return True
    

def main():
    s = input()
    c = 0
    while checkeof(s):
        tmp = s.count('01')
        if tmp:
            s = s.replace("01","")
            c += tmp
        tmp = s.count('10')
        if tmp:
            s = s.replace("10","")
            c += tmp
    print(c*2)
    
    
if __name__ == '__main__':
    main()


# CPython references:
#   https://www.python.org/
