main = do
  [n, a, b] <- map read . words <$> getLine
  let xs = [x | x <- [1 .. n], let y = digitSums x , y >= a, y <= b]
  print $ sum xs


digitSums :: Int -> Int
digitSums x
  | x >= 10   = x `mod` 10 + digitSums (x `div` 10)
  | otherwise = x `mod` 10

