module Main where

import Control.Applicative
import Control.Monad
import Data.List

sumd :: Int -> Int
sumd n
    | q == 0    = r
    | otherwise = r + sumd q
  where
    (q, r) = n `divMod` 10

main :: IO ()
main = do
    [n, a, b] <- fmap read . words <$> getLine :: IO [Int]
    let ans = filter ((\i -> a <= i && i <= b) . sumd) [1 .. n]
    print $ sum ans