from collections import deque



def updiv(a,b):

    if a % b == 0:

        return a // b

    else:

        return a // b + 1



N,D,A = list(map(int,input().split()))



XH = []



for i in range(N):



    x,h = list(map(int,input().split()))

    XH.append([x,h])



XH.sort()



q = deque([])

qs = 0

ans = 0



for i in range(N):



    X = XH[i][0]

    H = XH[i][1]



 

    while len(q) > 0 and q[0][0] < X-D:

        po = q.popleft()

        qs -= po[1] * A



    if H - qs <= 0:

        continue

        

    else:

        pl = updiv(H-qs,A)

        qs += pl * A

        ans += pl

        q.append([X+D,pl])



print (ans)

        

import bisect

from collections import deque

import math

n, d, A = list(map(int, input().split()))

xh = []

for _ in range(n):

    x, h = list(map(int, input().split()))

    xh.append([x, h])

xh.sort(key=lambda x: x[0])



monster_x = []

monster_hp = []

for i in range(n):

    monster_x.append(xh[i][0])

    monster_hp.append(xh[i][1])



dist = 2 * d

ans = 0

damage = 0

cum_damage = [0] * (n + 1)

for i in range(n):

    cum_damage[i + 1] += cum_damage[i]

    damage = cum_damage[i + 1] * A

    if damage < monster_hp[i]:

        min_attack_num = math.ceil((monster_hp[i] - damage) / A) 

        index = bisect.bisect_right(monster_x, monster_x[i] + dist)

        cum_damage[i + 1] += min_attack_num

        if index < n:

            t = min(index + 1, n)

            cum_damage[t] -= min_attack_num

        ans += min_attack_num



print(ans)
from collections import deque


def updiv(a, b):
    if a % b == 0:
        return a // b
    else:
        return a // b + 1


N, D, A = list(map(int, input().split()))
XH = []
for i in range(N):
    x, h = list(map(int, input().split()))
    XH.append([x, h])
XH.sort()
q = deque([])
qs = 0
ans = 0
for i in range(N):
    X = XH[i][0]
    H = XH[i][1]
    while len(q) > 0 and q[0][0] < X - D:
        po = q.popleft()
        qs -= po[1] * A
    if H - qs <= 0:
        continue
    else:
        pl = updiv(H - qs, A)
        qs += pl * A
        ans += pl
        q.append([X + D, pl])
print(ans)

import bisect
from collections import deque
import math

n, d, A = list(map(int, input().split()))
xh = []
for _ in range(n):
    x, h = list(map(int, input().split()))
    xh.append([x, h])
xh.sort(key=lambda x: x[0])
monster_x = []
monster_hp = []
for i in range(n):
    monster_x.append(xh[i][0])
    monster_hp.append(xh[i][1])
dist = 2 * d
ans = 0
damage = 0
cum_damage = [0] * (n + 1)
for i in range(n):
    cum_damage[i + 1] += cum_damage[i]
    damage = cum_damage[i + 1] * A
    if damage < monster_hp[i]:
        min_attack_num = math.ceil((monster_hp[i] - damage) / A)
        index = bisect.bisect_right(monster_x, monster_x[i] + dist)
        cum_damage[i + 1] += min_attack_num
        if index < n:
            t = min(index + 1, n)
            cum_damage[t] -= min_attack_num
        ans += min_attack_num
print(ans)

+import bisect +import math - -def updiv(a, b): -    if a % b == 0: -        return a // b -    else: -        return a // b + 1 - - -N, D, A = list(map(int, input().split())) -XH = [] -for i in range(N): +n, d, A = list(map(int, input().split())) +xh = [] +for _ in range(n): -    XH.append([x, h]) -XH.sort() -q = deque([]) -qs = 0 +    xh.append([x, h]) +xh.sort(key=lambda x: x[0]) +monster_x = [] +monster_hp = [] +for i in range(n): +    monster_x.append(xh[i][0]) +    monster_hp.append(xh[i][1]) +dist = 2 * d -for i in range(N): -    X = XH[i][0] -    H = XH[i][1] -    while len(q) > 0 and q[0][0] < X - D: -        po = q.popleft() -        qs -= po[1] * A -    if H - qs <= 0: -        continue -    else: -        pl = updiv(H - qs, A) -        qs += pl * A -        ans += pl -        q.append([X + D, pl]) +damage = 0 +cum_damage = [0] * (n + 1) +for i in range(n): +    cum_damage[i + 1] += cum_damage[i] +    damage = cum_damage[i + 1] * A +    if damage < monster_hp[i]: +        min_attack_num = math.ceil((monster_hp[i] - damage) / A) +        index = bisect.bisect_right(monster_x, monster_x[i] + dist) +        cum_damage[i + 1] += min_attack_num +        if index < n: +            t = min(index + 1, n) +            cum_damage[t] -= min_attack_num +        ans += min_attack_num