inlineintread(){ int r = 0,w = 1; char c = getchar(); while (c < '0' || c > '9'){ if (c == '-') w = -1; c = getchar(); } while (c >= '0' && c <= '9'){ r = (r << 3) + (r << 1) + (c ^ 48); c = getchar(); } return r * w; }
inlineintup(int a,int b){ if (a % b == 0) return a / b; return a / b + 1; }
structBIT{ int tr[N];
inlineintlowbit(int x){ return x & -x; }
inlinevoidmodify(int x,int k){ if (!x) return; for (re int i = x;i <= m;i += lowbit(i)) tr[i] += k; }
inlineintquery(int x){ int res = 0; for (re int i = x;i;i -= lowbit(i)) res += tr[i]; return res; } }tree;
signedmain(){ n = read(); d = read(); k = read(); for (re int i = 1;i <= n;i++){ int h; arr[i].x = read(); h = read(); arr[i].num = up(h,k); } sort(arr + 1,arr + n + 1); for (re int i = 1;i <= n;i++){ p.push_back(max(1ll,arr[i].x - d)); p.push_back(arr[i].x + d); s[i] = {max(1ll,arr[i].x - d),arr[i].x + d,arr[i].num}; } sort(p.begin(),p.end()); unique(p.begin(),p.end()); for (auto x:p) mp[x] = ++idx; for (re int i = 1;i <= n;i++){ s[i] = {mp[s[i].l],mp[s[i].r],s[i].num}; m = max(m,s[i].r); } sort(s + 1,s + n + 1); for (re int i = 1;i <= n;i++){ int cnt = s[i].num - tree.query(s[i].r) + tree.query(s[i].l - 1); if (cnt <= 0) continue; ans += cnt; tree.modify(s[i].r,cnt); } printf("%lld",ans); return0; }