#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(non_upper_case_globals)]
#![allow(non_snake_case)]
#![allow(unused_mut)]
#![allow(unused_variables)]
#![allow(dead_code)]

use itertools::Itertools;
use proconio::input;
use proconio::marker::{Chars, Usize1};

#[allow(unused_macros)]
#[cfg(debug_assertions)]
macro_rules! mydbg {
    //($arg:expr) => (dbg!($arg))
    //($arg:expr) => (println!("{:?}",$arg));
      ($($a:expr),*) => {
          eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
      }
}
#[cfg(not(debug_assertions))]
macro_rules! mydbg {
    ($($arg:expr),*) => {};
}

macro_rules! echo {
    ($($a:expr),*) => {
          $(println!("{}",$a))*
      }
}

use std::cmp::*;
use std::collections::*;
use std::ops::{Add, Div, Mul, Sub};

#[allow(dead_code)]
static INF_I64: i64 = 92233720368547758;
#[allow(dead_code)]
static INF_I32: i32 = 21474836;
#[allow(dead_code)]
static INF_USIZE: usize = 18446744073709551;
#[allow(dead_code)]
static M_O_D: usize = 1000000007;
#[allow(dead_code)]
static PAI: f64 = 3.1415926535897932;

trait IteratorExt: Iterator {
    fn toVec(self) -> Vec<Self::Item>;
}

impl<T: Iterator> IteratorExt for T {
    fn toVec(self) -> Vec<Self::Item> {
        self.collect()
    }
}

trait CharExt {
    fn toNum(&self) -> usize;
    fn toAlphabetIndex(&self) -> usize;
    fn toNumIndex(&self) -> usize;
}
impl CharExt for char {
    fn toNum(&self) -> usize {
        return *self as usize;
    }
    fn toAlphabetIndex(&self) -> usize {
        return self.toNum() - 'a' as usize;
    }
    fn toNumIndex(&self) -> usize {
        return self.toNum() - '0' as usize;
    }
}

trait VectorExt {
    fn joinToString(&self, s: &str) -> String;
}
impl<T: ToString> VectorExt for Vec<T> {
    fn joinToString(&self, s: &str) -> String {
        return self
            .iter()
            .map(|x| x.to_string())
            .collect::<Vec<_>>()
            .join(s);
    }
}

trait StringExt {
    fn get_reverse(&self) -> String;
}
impl StringExt for String {
    fn get_reverse(&self) -> String {
        self.chars().rev().collect::<String>()
    }
}

trait UsizeExt {
    fn pow(&self, n: usize) -> usize;
}
impl UsizeExt for usize {
    fn pow(&self, n: usize) -> usize {
        return ((*self as u64).pow(n as u32)) as usize;
    }
}

pub trait OpMonoid {
    type T: Clone + PartialEq;
    fn id() -> Self::T;
    fn op(a: &Self::T, b: &Self::T) -> Self::T;
    fn op2(a: &Self::T, b: &Self::T) -> Self::T;
    fn op3(a: &Self::T, b: &i64) -> Self::T;
}
pub struct LazySegTree<M: OpMonoid> {
    n: usize,
    data: Vec<M::T>,
    lazy: Vec<M::T>,
}
impl<M: OpMonoid> LazySegTree<M> {
    pub fn new(n_: usize) -> LazySegTree<M> {
        let mut n = 1 as usize;
        while (n < n_) {
            n *= 2;
        }
        LazySegTree {
            n: n,
            data: vec![M::id().clone(); (2 * n)],
            lazy: vec![M::id().clone(); (2 * n)],
        }
    }
    #[macro_use]
    pub fn update(&mut self, index: usize, v: M::T) {
        let mut k = index + self.n - 1;
        self.data[k] = v;
        while (k > 0) {
            k = (k - 1) / 2;
            self.data[k] = M::op(&self.data[2 * k + 1], &self.data[2 * k + 2]);
        }
    }
    pub fn eval(&mut self, k: usize, l: i32, r: i32) {
        if self.lazy[k] != M::id().clone() {
            if (r - l) > 1 {
                self.lazy[2 * k + 1] = M::op2(&self.lazy[2 * k + 1], &self.lazy[k]);
                self.lazy[2 * k + 2] = M::op2(&self.lazy[2 * k + 2], &self.lazy[k]);
            }
            self.data[k] = M::op2(&self.data[k], &M::op3(&self.lazy[k], &((r - l) as i64)));
            self.lazy[k] = M::id().clone();
        }
    }
    pub fn update_range_sub(&mut self, a: usize, b: usize, v: M::T, k: usize, l: i32, r: i32) {
        let mut r = r;
        if r < 0 {
            r = self.n as i32;
        }
        self.eval(k, l, r);
        if b as i32 <= l || r <= a as i32 {
            return;
        }
        if a as i32 <= l && r <= b as i32 {
            self.lazy[k] = v.clone();
            self.eval(k, l, r);
        } else {
            self.update_range_sub(a, b, v.clone(), 2 * k + 1, l, (l + r) / 2);
            self.update_range_sub(a, b, v.clone(), 2 * k + 2, (l + r) / 2, r);
            self.data[k] = M::op(&self.data[2 * k + 1], &self.data[2 * k + 2]);
        }
    }
    pub fn update_range(&mut self, l: usize, r: usize, v: M::T) {
        self.update_range_sub(l, r, v, 0, 0, -1);
    }
    pub fn query_sub(&mut self, a: usize, b: usize, k: usize, l: i32, r: i32) -> M::T {
        let mut r = r;
        if r < 0 {
            r = self.n as i32
        };
        if b as i32 <= l || r <= a as i32 {
            return M::id();
        }
        self.eval(k, l, r);
        if a as i32 <= l && r <= b as i32 {
            return self.data[k].clone();
        }
        let vl = self.query_sub(a, b, 2 * k + 1, l, (l + r) / 2);
        let vr = self.query_sub(a, b, 2 * k + 2, (l + r) / 2, r);
        return M::op(&vl, &vr);
    }
    pub fn query(&mut self, l: usize, r: usize) -> M::T {
        self.query_sub(l, r, 0, 0, -1)
    }
}
struct SUM;
impl OpMonoid for SUM {
    type T = i64;
    fn id() -> Self::T {
        0
    }
    fn op(a: &Self::T, b: &Self::T) -> Self::T {
        *a + *b
    }
    fn op2(a: &Self::T, b: &Self::T) -> Self::T {
        *a + *b
    }
    fn op3(a: &Self::T, b: &i64) -> Self::T {
        (*a) * (*b)
    }
}

use superslice::*;
fn main() {
    input! {
       N: usize,
       D:usize,
       A:i64,
    }

    let mut ans = 0;
    let mut b = vec![];
    let mut y = vec![];
    for _ in 0..N {
        input! {
            x:usize,
            h:usize,
        }
        b.push((x, h));
        y.push(x);
    }
    b.sort_by_key(|&x| x.0);
    y.sort();
    mydbg!(y);
    let mut seg: LazySegTree<SUM> = LazySegTree::new(N);
    for i in 0..N {
        let (_, h) = b[i];
        seg.update(i, h as i64);
    }
    for i in 0..N {
        let (x, h) = b[i];
        let index = y.upper_bound(&(x + D + D));
        let life = seg.query(i, i + 1);
        if life <= 0 {
            continue;
        }
        let a = (life + A - 1) / A;
        mydbg!(i, index, life, a);
        seg.update_range(i, index, -1 * a * A);
        ans += a;
    }

    echo!(ans);
}


Measured memory_bytes: 16988