{-# LANGUAGE BangPatterns #-}
module Main where

iter :: Int -> String -> (String, Int)
iter !n ('0' : '1' : xs) = iter (n + 2) xs
iter !n ('1' : '0' : xs) = iter (n + 2) xs
iter n (x : xs) = let (ys, r) = iter n xs in (x : ys, r)
iter n xs = (xs, n)

solve :: String -> Int
solve str = case iter 0 str of
  ([], n) -> n
  (xs, n) -> n + solve xs

main = getLine >>= print . solve
