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

solve n a b = sum $ filter f [1..n]
  where
    f x = let y = sum $ map (\a -> fromEnum a - fromEnum '0') (show x)
          in a <= y && y <= b
