import           Control.Monad
import           Data.List
import           Data.Ord
import           Data.List.Split
import qualified Data.Vector.Unboxed as V

main :: IO ()
main = do
  [n, a, b] <- map read . words <$> getLine
  let as = [map (\a -> read [a] :: Integer) (show x) | x <- [0, 1 .. n]]
  print
    $ sum . map (read . concatMap show)
    $ filter (\l -> sum l >= a && sum l <= b) as