import Data.Char ( digitToInt )

main :: IO ()
main = do
  [n,a,b] <- map read . words <$> getLine 
  print $ f n a b

f :: Int -> Int -> Int -> Int
f n a b = sum [ m | m <- [1..n]
                  , a   <= g m
                  , g m <= b ]
  where
    g = sumDigits

sumDigits
  :: Int -> Int
sumDigits = sum . map digitToInt . show 