import Data.Char

getInts :: IO [Int]
getInts = map read . words <$> getLine

infixl 1 |>
x |> f = f x

between :: Int -> Int -> Int -> Bool
between a b x = (a <= y) && (y <= b)
    where y = x |> show |> map digitToInt |> sum

main = do
  n:a:b:_ <- getInts
  [1..n] |> filter (between a b) |> sum |> show |> putStrLn
