module Main where

import Data.List
import Control.Monad
import Debug.Trace

solve :: String -> Int
solve s = inner [] s where
    inner remainder [] = 0
    inner remainder ('0':'1':c) = inner [] (reverse remainder ++ c) + 2
    inner remainder ('1':'0':c) = inner [] (reverse remainder ++ c) + 2
    inner remainder (a:b) = inner (a: remainder) b


main = do
    s <- getLine
    print $ solve s
