-- 先頭からリストを見ていって，[01, 10] パターンがあればそれをのぞいて再帰

solve :: String -> String -> Int -> Int
solve "" _ n = 2*n
solve ('0':'1':xs) ss n = solve (ss ++ xs) "" (n+1)
solve ('1':'0':xs) ss n = solve (ss ++ xs) "" (n+1)
solve (x:xs) ss n = solve xs (ss ++ [x]) n


main:: IO ()
main = do
  ss <- getLine
  putStrLn $ show (solve ss "" 0)
