import Data.List
import Data.Char
import Data.Map
import Control.Applicative
import Prelude


solve :: Int -> Int
solve x = length ( [a] |sum $ map (digitToInt)[a]==x )
  where [a]= zipWith (+) [a] [1,1..]

main = do
  s  <-  read  <$> getLine
  let ans= solve s
  putStrLn (++ans++)
