module M = Map.Make (struct type t = int let compare = compare end) ;;

Scanf.scanf "%d %d %d" (fun n d a ->
    let xh = Array.init n (fun _ -> Scanf.scanf " %d %d" (fun x h -> x, h)) in
    Array.sort compare xh;
    let add key v map = M.add key (v + try M.find key map with _ -> 0) map in
    let rec loop i event level bomb =
        if i = n then Printf.printf "%d\n" bomb else 
            let (x, h) = xh.(i) in
            if M.is_empty event then (
                let count = (h + a - 1) / a in
                let event = add (x + 2 * d) (-count * a) event in
                loop (i + 1) event (level + count * a) (bomb + count)
            ) else (
                let (next_x, decl) = M.min_binding event in
                if next_x < x then (
                    let event = M.remove next_x event in
                    loop i event (level + decl) bomb
                ) else (
                    if h <= level then (
                        loop (i + 1) event level bomb
                    ) else (
                        let count = (h - level + a - 1) / a in
                        let event = add (x + 2 * d) (-count * a) event in
                        loop (i + 1) event (level + count * a) (bomb + count)
                    )
                )
            )
    in
    loop 0 M.empty 0 0
)