import Data.List

main = getLine >>= print . solve . (\s -> (s, 0))
 
solve = sum . unfoldr f 
 
f ([], _) = Nothing
f ([x], _) = Nothing
f (('1':xs), n) = Just ((xs, succ n), 0)
f (('0':'1':xs), n) = Just ((xs, 0), n)
f (('0':'0':xs), _) = Just ((xs, 0), 0)
 