#include "bits/stdc++.h"
//region region
using std::vector;
using std::cin;
using std::cout;
using std::string;
using std::pair;
using std::queue;
using std::priority_queue;
using std::swap;
//endregion
//region define/typedef
#pragma warning(disable:4996)
//auto
#define var auto
#define cvar const auto&
//a..b-1
#define FOR(i, a, b) for(int (i) = (a); (i) < (b); (i)++)
//b..a
#define FORR(i, a, b) for(int (i) = (b); (i) >= (a); (i)--)
//0..n-1
#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
//1..n
#define rep1(i, n) for(int (i) = 1; (i) <= (n); (i)++)
//n-1..0
#define repr(i, n) for(int (i) = (n) - 1; (i) >= 0; (i)--)
//n-1..1
#define repr1(i, n) for(int (i) = (n); (i) > 0; (i)--)
#define in1(a) cin >> a
#define in2(a, b) cin >> a >> b
#define in3(a, b, c) cin >> a >> b >> c
#define in4(a, b, c, d) cin >> a >> b >> c >> d
#define in5(a, b, c, d, e) cin >> a >> b >> c >> d >> e
#define pb push_back
#define mp std::make_pair
#define mt std::make_tuple
#define endl "\n"
#define outif(b, t, f) cout << ((b) ? (t) : (f)) << endl
#define bsort(vec) std::sort((vec).begin(), (vec).end())
#define rsort(vec) std::sort((vec).rbegin(), (vec).rend())
#define all(vec) (vec).begin(), (vec).end()
#define even(i) (!(i&1))
#define odd(i) (i&1)
#define sz(x) (int((x).size()))
#define mset(v, n) std::memset((v), n, sizeof(v))
#define setminus(v) mset(v, -1)
#define setzero(v) mset(v, 0)
#define BIT(N) (1LL<<(N))
using ll = long long;
using lld = long double;
using uint = unsigned int;
using vint = vector<int>;
using vlong = vector<ll>;
using vstr = vector<string>;
using pii = pair<int, int>;
using pil = pair<int, ll>;
using pll = pair<ll, ll>;
using vpii = vector<pii>;
using vpil = vector<pil>;
using vpll = vector<pll>;
using vvint = vector<vint>;
using vvlong = vector<vlong>;
using vvstr = vector<vstr>;
const int MAX = INT32_MAX;
const int MIN = INT32_MIN;
const ll MAXL = INT64_MAX;
const ll MINL = INT64_MIN;
//endregion
//region methods/operator
#pragma warning (disable:6031)

ll parse(const string &num) {
    std::stringstream ss;
    ss << num << std::flush;
    ll n;
    ss >> n;
    return n;
}

string to_string(const ll n) {
    std::stringstream ss;
    ss << n << std::flush;
    return ss.str();
}

vector<string> split(const string &s, const string &delim) {
    vector<string> res;
    auto pos = 0;
    while (true) {
        const int found = s.find(delim, pos);
        if (found >= 0) {
            res.push_back(s.substr(pos, found - pos));
        } else {
            res.push_back(s.substr(pos));
            break;
        }
        pos = found + delim.size();
    }
    return res;
}

template<typename T>
string join(vector<T> &vec, const string &sep = " ") {
    var size = vec.size();
    if (size == 0) return "";
    std::stringstream ss;
    for (int i = 0; i < size - 1; i++) {
        ss << vec[i] << sep;
    }
    ss << vec[size - 1];
    return ss.str();
}

template<typename T>
std::istream &operator>>(std::istream &is, vector<T> &vec) {
    for (T &x : vec) is >> x;
    return is;
}

template<typename T>
void print(T t) {
    cout << t << endl << std::flush;
}

ll powmod(ll a, ll b, ll p) {
    ll res = 1;
    while (b > 0) {
        if (b % 2) res = res * a % p;
        a = a * a % p;
        b >>= 1;
    }
    return res;
}

ll gcd(ll a, ll b) {
    if (a < b) gcd(b, a);
    ll r;
    while ((r = a % b)) {
        a = b;
        b = r;
    }
    return b;
}

ll lcm(const ll a, const ll b) { return a / gcd(a, b) * b; }

template<class T>
bool chmax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

template<class T>
bool chmin(T &a, const T &b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}

//endregion
//region initialize

struct iii {
    iii() {
        cin.tie(nullptr);
        std::ios::sync_with_stdio(false);
        cout << std::fixed << std::setprecision(16);
    }
} init;

//endregion

template<typename Monoid, typename OperatorMonoid = Monoid>
struct LazySegmentTree {
    using F = std::function<Monoid(Monoid, Monoid)>;
    using G = std::function<Monoid(Monoid, OperatorMonoid)>;
    using H = std::function<OperatorMonoid(OperatorMonoid, OperatorMonoid)>;
    
    int sz, height;
    vector<Monoid> data;
    vector<OperatorMonoid> lazy;
    const F f;
    const G g;
    const H h;
    const Monoid M1;
    const OperatorMonoid OM0;
    
    
    LazySegmentTree(int n, const F f, const G g, const H h,
                    const Monoid &M1, const OperatorMonoid OM0)
    : f(f), g(g), h(h), M1(M1), OM0(OM0) {
        sz = 1;
        height = 0;
        while (sz < n) sz <<= 1, height++;
        data.assign(2 * sz, M1);
        lazy.assign(2 * sz, OM0);
    }
    
    void set(int k, const Monoid &x) {
        data[k + sz] = x;
    }
    
    void build() {
        for (int k = sz - 1; k > 0; k--) {
            data[k] = f(data[2 * k + 0], data[2 * k + 1]);
        }
    }
    
    inline void propagate(int k) {
        if (lazy[k] != OM0) {
            lazy[2 * k + 0] = h(lazy[2 * k + 0], lazy[k]);
            lazy[2 * k + 1] = h(lazy[2 * k + 1], lazy[k]);
            data[k] = reflect(k);
            lazy[k] = OM0;
        }
    }
    
    inline Monoid reflect(int k) {
        return lazy[k] == OM0 ? data[k] : g(data[k], lazy[k]);
    }
    
    inline void recalc(int k) {
        while (k >>= 1) data[k] = f(reflect(2 * k + 0), reflect(2 * k + 1));
    }
    
    inline void thrust(int k) {
        for (int i = height; i > 0; i--) propagate(k >> i);
    }
    
    void update(int a, int b, const OperatorMonoid &x) {
        thrust(a += sz);
        thrust(b += sz - 1);
        for (int l = a, r = b + 1; l < r; l >>= 1, r >>= 1) {
            if (l & 1) lazy[l] = h(lazy[l], x), ++l;
            if (r & 1) --r, lazy[r] = h(lazy[r], x);
        }
        recalc(a);
        recalc(b);
    }
    
    Monoid query(int a, int b) {
        thrust(a += sz);
        thrust(b += sz - 1);
        Monoid L = M1, R = M1;
        for (int l = a, r = b + 1; l < r; l >>= 1, r >>= 1) {
            if (l & 1) L = f(L, reflect(l++));
            if (r & 1) R = f(reflect(--r), R);
        }
        return f(L, R);
    }
    
    Monoid operator[](const int &k) {
        return query(k, k + 1);
    }
    
    template<typename C>
    int find_subtree(int a, const C &check, Monoid &M, bool type) {
        while (a < sz) {
            propagate(a);
            Monoid nxt = type ? f(reflect(2 * a + type), M) : f(M, reflect(2 * a + type));
            if (check(nxt)) a = 2 * a + type;
            else M = nxt, a = 2 * a + 1 - type;
        }
        return a - sz;
    }
    
    template<typename C>
    int find_first(int a, const C &check) {
        Monoid L = M1;
        if (a <= 0) {
            if (check(f(L, reflect(1)))) return find_subtree(1, check, L, false);
            return -1;
        }
        thrust(a + sz);
        int b = sz;
        for (a += sz, b += sz; a < b; a >>= 1, b >>= 1) {
            if (a & 1) {
                Monoid nxt = f(L, reflect(a));
                if (check(nxt)) return find_subtree(a, check, L, false);
                L = nxt;
                ++a;
            }
        }
        return -1;
    }
    
    
    template<typename C>
    int find_last(int b, const C &check) {
        Monoid R = M1;
        if (b >= sz) {
            if (check(f(reflect(1), R))) return find_subtree(1, check, R, true);
            return -1;
        }
        thrust(b + sz - 1);
        int a = sz;
        for (b += sz; a < b; a >>= 1, b >>= 1) {
            if (b & 1) {
                Monoid nxt = f(reflect(--b), R);
                if (check(nxt)) return find_subtree(b, check, R, true);
                R = nxt;
            }
        }
        return -1;
    }
};
int main() {
#define int ll
    int N, D, A;
    scanf("%lld%lld%lld", &N, &D, &A);
    vector<pii> monsters(N);
    rep(i, N) {
        int t1, t2;
        scanf("%lld%lld", &t1, &t2);
        monsters[i] = mp(t1, t2);
        assert(t2 > 0);
    }
    bsort(monsters);
    vector<int> cood(N);
    rep(i, N)cood[i] = monsters[i].first;
    
    LazySegmentTree<int, int> segmentTree(N,
                                          [&](int a, int b) { return std::max(a,b); },
                                          [&](int a, int b) { return a - b; },
                                          [&](int a, int b) { return a + b; }, 0, 0);
    rep(i, N)segmentTree.set(i, monsters[i].second);
    segmentTree.build();
    
    //  cout << segmentTree[0] << " " << segmentTree[1] << endl;
    ll ans = 0;
    rep(start, N) if(segmentTree[start] > 0){
        cvar cnt = (segmentTree[start] + A - 1) / A;
        ans += cnt;
        int end = std::upper_bound(all(cood), cood[start] + 2 * D) - cood.begin();
        segmentTree.update(start, end, A * cnt);
    }
    cout << ans << endl;
}


Measured memory_bytes: 11648