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



Monster = [0]*N

for i in range(N):

    Monster[i] = list(map(int, input().split()))



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



from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort



from collections import deque



d = deque()

damage = 0

ans = 0

for i in range(N):

    while len(d)>0:

        a = d.popleft()

        if a[0]==i:

            damage -= a[1]

        else:

            d.appendleft(a)

            break

    Monster[i][1] -= damage

    count = -(-max(Monster[i][1],0)//A)

    ans += count

    right = Monster[i][0]+2*D

    ind = bisect(Monster,[right,10**9+1])

    damage += A*count

    d.append([ind,A*count])

print(ans)
from bisect import *

def solve():

  ans = 0

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

  B = [list(map(int, input().split())) for _ in range(N)]

  B.sort()

  lasts = [0]*(N+1)

  now = 0

  for i,((x,h),l) in enumerate(zip(B,lasts)):

    now -= l

    atack = max(0,-(-(h-now)//A))

    ans += atack

    damage = atack*A

    now += damage

    last = x+2*D

    ind = bisect_right(B,[last+1,0])

    lasts[ind] += damage

  return ans

print((solve()))
N, D, A = list(map(int, input().split()))
Monster = [0] * N
for i in range(N):
    Monster[i] = list(map(int, input().split()))
Monster.sort(key=lambda x: x[0])
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from collections import deque

d = deque()
damage = 0
ans = 0
for i in range(N):
    while len(d) > 0:
        a = d.popleft()
        if a[0] == i:
            damage -= a[1]
        else:
            d.appendleft(a)
            break
    Monster[i][1] -= damage
    count = -(-max(Monster[i][1], 0) // A)
    ans += count
    right = Monster[i][0] + 2 * D
    ind = bisect(Monster, [right, 10**9 + 1])
    damage += A * count
    d.append([ind, A * count])
print(ans)

from bisect import *


def solve():
    ans = 0
    N, D, A = list(map(int, input().split()))
    B = [list(map(int, input().split())) for _ in range(N)]
    B.sort()
    lasts = [0] * (N + 1)
    now = 0
    for i, ((x, h), l) in enumerate(zip(B, lasts)):
        now -= l
        atack = max(0, -(-(h - now) // A))
        ans += atack
        damage = atack * A
        now += damage
        last = x + 2 * D
        ind = bisect_right(B, [last + 1, 0])
        lasts[ind] += damage
    return ans


print((solve()))

-N, D, A = list(map(int, input().split())) -Monster = [0] * N -for i in range(N): -    Monster[i] = list(map(int, input().split())) -Monster.sort(key=lambda x: x[0]) -from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort -from collections import deque +from bisect import * -d = deque() -damage = 0 -ans = 0 -for i in range(N): -    while len(d) > 0: -        a = d.popleft() -        if a[0] == i: -            damage -= a[1] -        else: -            d.appendleft(a) -            break -    Monster[i][1] -= damage -    count = -(-max(Monster[i][1], 0) // A) -    ans += count -    right = Monster[i][0] + 2 * D -    ind = bisect(Monster, [right, 10**9 + 1]) -    damage += A * count -    d.append([ind, A * count]) -print(ans) + +def solve(): +    ans = 0 +    N, D, A = list(map(int, input().split())) +    B = [list(map(int, input().split())) for _ in range(N)] +    B.sort() +    lasts = [0] * (N + 1) +    now = 0 +    for i, ((x, h), l) in enumerate(zip(B, lasts)): +        now -= l +        atack = max(0, -(-(h - now) // A)) +        ans += atack +        damage = atack * A +        now += damage +        last = x + 2 * D +        ind = bisect_right(B, [last + 1, 0]) +        lasts[ind] += damage +    return ans + + +print((solve()))