s = input()

count = 0
while True:
    s0 = s
    if s.count("10") != 0:
        count += 2 * s.count("10")
        s = s.replace("10","")
        #print(s)
    elif s.count("01") != 0:
        count += 2 * s.count("01")
        s = s.replace("01","")
        #print(s)
    if s0 == s:
        break

#print(s)
print(count)


"""
s = input()

count = 0
while True:
    s0 = s
    s = s.replace("10","",1)
    if s0 != s:
        count += 2
        #print(s)
    else:
        s1 = s
        s = s.replace("01","",1)
        if s1 != s:
            count += 2
            #print(s)
        else:
            break

#print(s)
print(count)
"""