import Data.Char (digitToInt)

sumOfDigit :: Int -> Int
sumOfDigit num = sum . map digitToInt $ show num

main :: IO ()
main = do
    [num, min, max] <- map read . words <$> getLine
    let calculated = filter (\x -> sumOfDigit x <= max && min <= sumOfDigit x) [1 .. num]
    print $ sum calculated 