
import qualified Data.ByteString.Char8 as B

solv bs = go bs (0,0) where
  go bs (z,o)
    | B.null bs      = 2 * min z o
    | B.head bs=='0' = go (B.tail bs) (z+1,o)
    | otherwise      = go (B.tail bs) (z,o+1)

main = do
  xs <- B.getLine
  print $ solv xs
