import numpy as np

def erase(lis, cnt):
    #print("try")
    i = 0
    this_cnt = 0
    while(i < len(lis)-1):
        
        if lis[i] != lis[i+1]:
            del lis[i]
            del lis[i]
            this_cnt += 1
            cnt += 1
            #print(cnt, lis)
        else:
            i+=2
    #print("cnt so far: ", cnt, "this_cnt: ", this_cnt)
    if this_cnt > 0:
        erase(lis, cnt)

    return cnt

        
def main():
    string = input()
    lis = [int(v) for v in string]
    
    #print(lis)
    cnt = erase(lis, 0)
    #print(cnt)
    ans = cnt * 2
    print(ans)
main()
