digitSum n
    | n < 10 = n
    | otherwise = r + digitSum q
  where (q, r) = divMod n 10

inRange x a b = a <= x && x <= b

main = do
    [n, a, b] <- map read . words <$> getLine :: IO [Int]
    print $ sum [i | i <- [1..n], inRange (digitSum i) a b]
