import sys

def parse(inp):
    S=list(map(int,list(next(inp))))
    return S

def main(inp):
    S=inp
    i = 0
    count = 0
    while i < len(S)-1:
        if(S[i] != S[i+1]):
            del S[i:i+2]
            i=0
            count += 2
        else: i += 1
            
    return count
  
print(main(parse(sys.stdin)))