import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Data.Text.Read as T
import Data.List (sort)

main :: IO ()
main = do
  (n : d : a : _) <- map unsafeTextToInt . T.words <$> T.getLine :: IO [Int]
  let
    walk :: Int -> Int -> [(Int, Int)] -> [(Int, Int)] -> [(Int, Int)]
    walk _ _ [] _ = []
    walk 0 _ ((x, h) : xhs') yks = (x, k') : walk 1 k' xhs' yks
      where
        k' = (h + a - 1) `div` a
    walk l c xhs@((x, _) : _) ((y, k) : yks') | y + 2 * d < x = walk (pred l) (c - k) xhs yks'
    walk l c ((x, h) : xhs') yks = (x, k') : walk (succ l) (c + k') xhs' yks
      where
        k' = (max 0 (h - c * a) + a - 1) `div` a
  xhs <- sequence . replicate n $ unsafeListToTuple . map unsafeTextToInt . T.words <$> T.getLine :: IO [(Int, Int)]
  print . sum . map snd . fix . walk 0 0 . sort $ xhs

fix :: (a -> a) -> a
fix f = x
  where
    x = f x

unsafeListToTuple :: [Int] -> (Int, Int)
unsafeListToTuple (x : y : _) = (x, y)

unsafeTextToInt :: T.Text -> Int
unsafeTextToInt s = case T.signed T.decimal s of
  Right (n, _) -> n
