import Control.Applicative
import Control.Monad
import Data.List
import Data.Array
import Data.Char

main = do
  [n, a, b] <- map (read::String -> Int) . words <$> getLine
  let digitSums = zip [1..n] $ map sumDigit [1..n]
  print . sum . map fst $ filter (\(x, s) -> s >= a && s <= b) digitSums


sumDigit::Int -> Int
sumDigit n
  | n == 0 = 0
  | otherwise = n `mod` 10 + sumDigit (n `div` 10)

