main = do
    ls <- getLine
    print $ solve ls

solve :: String -> Int
solve ls = machine (0,0) ls 0

machine :: (Int, Int) -> String -> Int -> Int
machine (r,b) []      ac = ac 
machine (r,b) ('0':ls) ac =
    if b > 0
    then machine (r,b-1) ls (ac+2)
    else machine (r+1,b) ls ac
machine (r,b) ('1':ls) ac =
    if r > 0
    then machine (r-1,b) ls (ac+2)
    else machine (r,b+1) ls ac