sumOfDigit :: Int -> Int -> Int
sumOfDigit total 0 = total
sumOfDigit total n = sumOfDigit (total + r) q
  where
    q = n `div` 10
    r = n `mod` 10

main = do
  line <- getLine
  let
    [n,a,b] = map read $ words line :: [Int]
    ans = sum
      $ map (\x -> fst x)
      $ filter (\(_, x) -> a <= x && x <= b)
      $ map (\x -> (x, (sumOfDigit 0 x))) [1..n]
  putStrLn $ show ans
