s = input()

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

#print(s)
print(count)
