#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cmath>
using namespace std;
using ll = long long;

struct SegmentTree {
    struct Node {
        Node operator*(const Node &o) const {
            return { v + o.v };
        }
        ll v;
    };
    using Lazy = ll;

    SegmentTree(int n) : e({ 0 }), n(n) {
        for (m = 2; m < n; m *= 2);
        t = vector<Node>(m + n + n % 2, e);
        z = vector<Lazy>(m, 0);
    }
    Node &operator[](int i) {
        return t[m + i];
    }
    const Node &root() const {
        return t[1];
    }
    void build() {
        for (int i = (n - 1 + m) / 2; i > 0; i--) t[i] = t[i * 2] * t[i * 2 + 1];
    }
    void update(int i, const Node &o) {
        i += m;
        for (int j = m; j >= 2; j /= 2) propagate(i / j, j);
        for (t[i] = o; i /= 2, i > 0;) t[i] = t[i * 2] * t[i * 2 + 1];
    }
    Node query(int l, int r, int i = 1, int il = 0, int ir = -1) {
        if (ir < 0) ir = m;
        if (l <= il && ir <= r) return t[i];
        propagate(i, ir - il);
        Node o = e;
        int ic = (il + ir) / 2;
        if (l < ic) o = o * query(l, r, i * 2 + 0, il, ic);
        if (ic < r) o = o * query(l, r, i * 2 + 1, ic, ir);
        return o;
    }
    void range_act(int l, int r, Lazy x, int i = 1, int il = 0, int ir = -1) {
        if (ir < 0) ir = m;
        if (l <= il && ir <= r) { act(i, ir - il, x); return; }
        propagate(i, ir - il);
        int ic = (il + ir) / 2;
        if (l < ic) range_act(l, r, x, i * 2 + 0, il, ic);
        if (ic < r) range_act(l, r, x, i * 2 + 1, ic, ir);
        t[i] = t[i * 2] * t[i * 2 + 1];
    }
    void propagate(int i, int w) {
        if (z[i] == 0) return;
        for (int j = 0; j < 2; j++) act(i * 2 + j, w / 2, z[i]);
        z[i] = 0;
    }
    void act(int i, int w, Lazy x) {
        t[i].v += x * w;
        if (i < m) z[i] += x;
    }
    void print() {
        for (int j = 1; j <= m; j *= 2) {
            int k = min(j * 2, m + n);
            for (int i = j; i < k; i++) {
                if (j < m) {
                    cout << t[i].v << ':' << z[i] << string(m / j * 2 - 4, ' ') << " \n"[i == k - 1];
                } else {
                    cout << t[i].v << " \n"[i == k - 1];
                }
            }
        }
    }
    vector<Node> t;
    vector<Lazy> z;
    const Node e;
    int n, m;
};

struct P {
    bool operator<(const P &p) const {
        return x < p.x;
    }
    int x, h;
};

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int n, d, a;
    cin >> n >> d >> a;

    d = d * 2 + 1;

    vector<P> p(n);
    for (int i = 0; i < n; i++) {
        int x, h;
        cin >> x >> h;
        p[i] = { x, (h + a - 1) / a };
    }
    sort(p.begin(), p.end());

    SegmentTree st(n);
    for (int i = 0; i < n; i++) {
        st[i] = { p[i].h };
    }
    st.build();

    ll r = 0;
    for (int i = 0; i < n; i++) {
        ll a = st.query(i, i + 1).v;
        if (a <= 0) continue;
        r += a;
        int k = lower_bound(p.begin() + i, p.end(), P{ (int)min((ll)p[i].x + d, 1LL << 30), 0 }) - (p.begin() + i);
        st.range_act(i, i + k, -a);
    }

    cout << r << endl;

    return 0;
}

Measured memory_bytes: 7552