import Data.Char

main :: IO ()
main = do
    [n, a, b] <- map read . words <$> getLine
    print $ sum [ k | k <- [1 .. n], a <= evaluate k, evaluate k <= b ]
    where evaluate x = sum [ digitToInt c | c <- show x ]
