main :: IO () main = print . solve =<< getLine table :: [Int] table = [1, 0, 0, 0, 1, 0, 1, 0, 2, 1] solve :: String -> Int solve s = 1 + t2 + t1 + 1 + t2 where t1 = length s t2 = sum . map ((table !!) . read . pure) $ s