s = input()
ans = 0
while 1:
    
    temp1 = s.count("01")
    ans += temp1
    s = s.replace("01", "")
    temp2 = s.count("10")
    ans += temp2
    s = s.replace("10", "")
    if temp1 == 0 and temp2 == 0:
        break
    
print(ans*2)
