import Control.Monad
import Data.List
main = do
  [n, a, b] <- words <$> getLine
  putStrLn.show $ solved a b n

cho:: Int -> [String]
cho n = map show [x | x <- [1..n] ]

parse:: String -> [Int]
parse str = map (read . return) str

hoge s = zip [1..10000] $ map (foldl (+) 0) $ map parse $ cho $ read s

fi:: Int -> Int -> (Int, Int) -> Bool
fi a b z
  | a <= zr && zr <= b = True
  | otherwise = False
  where
    zr = snd z

solved:: String -> String -> String -> Int
solved a b s = do
   foldl (+) 0 $ map fst $ filter (fi (read a) (read b)) $ hoge s
