import Data.Char(digitToInt)

sumAllDigit = sum . (map digitToInt) . show
main :: IO ()
main = do
    [n,a,b] <- map read . words <$> getLine 
    print $ sum $ filter (\xs -> a <= (sumAllDigit xs) && (sumAllDigit xs) <=  b) [x | x <- [1..n]]
