{-# OPTIONS_GHC -O2 -funbox-strict-fields #-}
import qualified Data.ByteString.Char8 as BC
import           Data.Char             (digitToInt)
import           Data.Maybe            (fromJust)

main :: IO ()
main = do
  [n, a, b] <- readInts
  print $ solve n a b

readInts :: IO [Int]
readInts = map (fst . fromJust . BC.readInt) . BC.words <$> BC.getLine

solve n a b = sum [x | x <- [1 .. n], sat x]
  where sat x = a <= sumDigits && sumDigits <= b
          where sumDigits = sum . map digitToInt $ show x

