#include <bits/stdc++.h>
#define lli long long int
#define pb push_back
#define mod2 998244353
#pragma GCC optimize("-O2")
#define mod3 127
#define mod 1000000007
#define MAXN 1000000000
#define v32 vector<int>
#define v64 vector<lli>
#define v1024 vector<vector<int>>
#define v4096 vector<vector<lli>>
#define vt vector
#define f(x, y, z) for (lli x = y; x < z; x++)
#define fd(x, y, z) for (lli x = y; x > z; x--)
#define lb lower_bound
#define ld long double
#define m64 map<lli, lli>
#define m32 map<int, int>
#define m64it map<lli, lli>::iterator
#define m32it map<int, int>::iterator
#define fastio                    \
ios_base::sync_with_stdio(0); \
cin.tie(0);                   \
cout.tie(0)
#define ist insert
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
#define p_q priority_queue
#define min_p_q priority_queue<int, vt<int>, greater<int>>
using namespace std;
using namespace __gnu_pbds;
lli tmod(lli x, lli y)
{
    return (x % y + y) % y;
}
template <typename T>
void DEBUG_ARR(vt<T> a)
{
    f(i, 0, a.size()) cout << a[i] << " ";
    cout << "\n";
}
lli power(lli x, lli y) 
{
    lli res = 1;  
    while (y > 0) 
    { 
        if (y & 1) 
            res = (res*x)%mod; 
        y = y>>1; 
        x = (x*x)%mod;
    }
    if(res<0)res+=mod;
    return res; 
}
class LAZY //currently set to set a given range by a value
{
   public:
   struct node
   {
    int l,r,lazy=0;lli lazyval=0;
    lli sum=0;
   };	
   vt <node> st;v64 h;
   LAZY(v64 a)
   { 
   	  h=a;
   	  st.resize(4*h.size());
   	  cst(0,h.size()-1);
   }	
   void cst(int l,int r,int k=0)
   {
    st[k].l=l,st[k].r=r;
    if(l==r)
        { 
          st[k].sum=h[l];   
          return;
        }
    cst(l,(l+r)/2,2*k+1);
    cst((l+r)/2+1,r,2*k+2);
    st[k].sum=st[2*k+1].sum+st[2*k+2].sum;    
   }
   void shift(int k)
   {
   st[k].sum+=(st[k].r-st[k].l+1)*st[k].lazyval;
   if(st[k].l!=st[k].r)
   {st[2*k+1].lazyval+=st[k].lazyval;
   st[2*k+2].lazyval+=st[k].lazyval;
   st[2*k+1].lazy=st[2*k+1].lazy=1;
   st[2*k+2].lazy=st[2*k+2].lazy=1;}
   st[k].lazyval=0;
   st[k].lazy=0;      
   }
   lli query(int l,int r,int k=0)
   {
	  if(st[k].lazy) shift(k);
    int ll=st[k].l,rr=st[k].r;
    if(ll>r || rr<l)return 0;
    if(ll>=l && rr<=r)
    return st[k].sum;
    return query(l,r,2*k+1)+query(l,r,2*k+2);     
   }
   void update(int l,int r,lli x,int k=0)
   {
   int ll=st[k].l,rr=st[k].r;
   if(ll>r || rr<l)return ;
   if(ll>=l && rr<=r)
         {st[k].lazyval+=x;
          st[k].lazy=1;      
         return;}
         if(st[k].lazy)
           shift(k);
           if(ll==rr) return;
   update(l,r,x,2*k+1);
   update(l,r,x,2*k+2);
      if(st[2*k+1].lazy)
       shift(2*k+1);
       if(st[2*k+2].lazy)
       shift(2*k+2);
    st[k].sum=st[2*k+1].sum+st[2*k+2].sum;           
   }

};
int main()
{   
    fastio;
    lli n,d,a;
    cin>>n>>d>>a;
    vt<pair<lli,lli>> monster;
    f(i,0,n){
        lli xx,hh;cin>>xx>>hh;
        monster.push_back({xx,hh});
    }
    sort(monster.begin(),monster.end());
    v64 forST,x;
    f(i,0,n){
        x.push_back(monster[i].first);
        forST.push_back(monster[i].second);
    }
    LAZY ST(forST);
    lli ans=0;
    f(i,0,n){
        lli val=ST.query(i,i);
        if(val<=0)continue;
        else{
            lli cnt=(val-1)/a+1;
            ans+=cnt;
            int pos=lower_bound(x.begin(),x.end(),x[i]+2*d)-x.begin();
            if(pos==n)pos--;
            else{
                if(x[pos]>x[i]+2*d)pos--;
            }
            ST.update(i,pos,-cnt*a);
        }
    }
    cout<<ans<<"\n";
    return 0;
}


Measured memory_bytes: 37228