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


main = do
  s  <-  read  <$> getLine
  putStrLn( show $ solve s)
  


solve :: Int -> Int
solve x = length [[a] | a<-[1,2..10^10]::[Int] ,r<-[1,2..10^10]::[Int],s<-[r..], [a]==[r..s],(sum $ map(digit)[a])==x]

digit :: Int -> Int
digit  = length . show 