-- some-sums.hs --- Some Sums

-- author: Seong Yong-ju <sei40kr@gmail.com>

dsum :: Int -> Int
dsum 0 = 0
dsum x = x `mod` 10 + dsum (quot x 10)

between :: Int -> Int -> Int -> Bool
between l r x
  | l <= x = x <= r
  | otherwise = False

main :: IO ()
main = do
  [n, a, b] <- map (read :: String -> Int) . words <$> getLine
  print $ sum [x | x <- [0 .. n], between a b (dsum x)]
