#include <bits/stdc++.h>
    using namespace std;

    typedef unsigned long long ull;
    typedef long long ll;
    typedef long double ld;
    typedef pair<int, int> PII;
    typedef pair<int, ll> PILL;
    typedef pair<ll, ll> PLL;

    const int MAX_N = 2e5+5;
    const int M = 1e6;
    const ll INF = (ll)(1e18);
    const int inf = 1e9;
    const ll MOD = 1000000007LL;

    void solve() {

    }

    int n;
    ll a, d;
    vector<PLL> mon;
    map<ll, int> xToPos;
    map<int, ll> posToX;

    ll t[5*MAX_N], lazy[5*MAX_N];

    void print() {
        for (int i = 1; i <= 13; i++) {
            cout << i << ": " << t[i] << " " << lazy[i] << "\n";
        }
    }

    void build(int v, int l, int r) {
        if (l == r) {
            t[v] = mon[l].second;
            return;
        }
        int mid = (l+r) / 2;
        build(2*v, l, mid);
        build(2*v+1, mid+1, r);

        t[v] = max(t[2*v], t[2*v+1]);
    }

    void push(int v, int l, int r) {
        if (l == r) return;
        t[2*v] += lazy[v];
        t[2*v+1] += lazy[v];
        lazy[2*v] += lazy[v];
        lazy[2*v+1] += lazy[v];
        lazy[v] = 0LL;
    }

    void update(int v, int l, int r, int qL, int qR, ll val) {
        if (qL <= l && r <= qR) {
            t[v] += val;
            lazy[v] += val;
            return;
        }
        if (l > qR || r < qL) return;

        push(v, l, r);
        int mid = (l+r) / 2;
        update(2*v, l, mid, qL, qR, val);
        update(2*v+1, mid+1, r, qL, qR, val);

        t[v] = max(t[2*v], t[2*v+1]);
    }

    PILL query(int v, int l, int r) {
        if (l == r) {
            if (t[v] > 0) return {l, t[v]};
            return {inf, -1LL};
        }

        push(v, l, r);
        int mid = (l+r) / 2;
        PILL res = {inf, -1LL};
        if (t[2*v] > 0) {
            res = query(2*v, l, mid);
        } else if (t[2*v+1] > 0) {
            res = query(2*v+1, mid+1, r);
        }

        t[v] = max(t[2*v], t[2*v+1]);

    	return res;
    }

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

        cin >> n >> d >> a;
        mon.resize(n+1);
        for (int i = 1; i <= n; i++) {
            cin >> mon[i].first >> mon[i].second;
        }

        sort(mon.begin()+1, mon.end());
        int cur = 1;

        for (int i = 1; i <= n; i++) {
            xToPos[mon[i].first] = cur;
            posToX[cur] = mon[i].first;
            cur++;
        }

    	/*for (int i = 1; i <= n; i++) {
    		cout << mon[i].first << " ";
    	}
    	cout << "\n";*/

        build(1, 1, n);

        ll ans = 0LL;
        /*print();
        cout << "\n";*/
        while (true) {
            PILL res = query(1, 1, n);
            int pos = res.first;
            ll sum = res.second;
            //cout << "D: " << sum << " " << pos << "\n";
            if (pos == inf) break;
            ll cnt = (sum+a-1) / a;
            ans += cnt;
            ll val = cnt*a;
            ll x = posToX[pos];
            auto it = lower_bound(mon.begin()+1, mon.end(), make_pair(x+2*d+1, -1LL));
    		it--;
            x = (*it).first;
            int pos2 = xToPos[x];
            //cout << "D2: " << pos << " " << pos2 << "\n";
            update(1, 1, n, pos, pos2, -val);
            //print();

        }

        cout << ans << "\n";



        return 0;
    }


Measured memory_bytes: 40704