
main::IO()
main=do
   n <- read <$> getLine
   print $ solve (bs n) n 0
   where
     bs::Integer->Integer
     bs=ceiling . (logBase 10 ) . fromIntegral
     solve::Integer->Integer->Integer->Integer
     solve base 0 ans=((ans -1) `div` 9) +1
     solve base val ans= solve (base-1) (val `mod` x) (ans + (val `div` x))
       where
         x=(10^base) `div` 9
         