from math import ceil

from collections import deque



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

Monsters = sorted([list(map(int, input().split())) for i in range(N)])

Monsters = [[x, ceil(h/H)] for x, h in Monsters]



ans = 0

acc = 0

deq = deque([])



for x, h in Monsters:

  while deq and x>deq[0][0]:

    lim, dam = deq.popleft()

    acc -= dam

  c = max(0, h-acc)

  ans += c

  acc += c

  if c:

    deq += [(x+2*D, c)]

    

print(ans)
from collections import deque

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

ls = []

for i in range(N):

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

  h = h//A if h%A==0 else h//A+1

  ls += [(x,h)]

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

deq = deque([])

ans = 0

acc = 0

for i in range(N):

  x, h = ls[i]

  while deq and deq[0][0]<x:

    y, d = deq.popleft()

    acc -= d

  n = max(0,h-acc)

  ans += n

  acc += n

  if n:

    deq += [(x+2*D,n)]

print(ans)
from math import ceil
from collections import deque

N, D, H = list(map(int, input().split()))
Monsters = sorted([list(map(int, input().split())) for i in range(N)])
Monsters = [[x, ceil(h / H)] for x, h in Monsters]
ans = 0
acc = 0
deq = deque([])
for x, h in Monsters:
    while deq and x > deq[0][0]:
        lim, dam = deq.popleft()
        acc -= dam
    c = max(0, h - acc)
    ans += c
    acc += c
    if c:
        deq += [(x + 2 * D, c)]
print(ans)

from collections import deque

N, D, A = list(map(int, input().split()))
ls = []
for i in range(N):
    x, h = list(map(int, input().split()))
    h = h // A if h % A == 0 else h // A + 1
    ls += [(x, h)]
ls.sort(key=lambda x: x[0])
deq = deque([])
ans = 0
acc = 0
for i in range(N):
    x, h = ls[i]
    while deq and deq[0][0] < x:
        y, d = deq.popleft()
        acc -= d
    n = max(0, h - acc)
    ans += n
    acc += n
    if n:
        deq += [(x + 2 * D, n)]
print(ans)

-from math import ceil -N, D, H = list(map(int, input().split())) -Monsters = sorted([list(map(int, input().split())) for i in range(N)]) -Monsters = [[x, ceil(h / H)] for x, h in Monsters] +N, D, A = list(map(int, input().split())) +ls = [] +for i in range(N): +    x, h = list(map(int, input().split())) +    h = h // A if h % A == 0 else h // A + 1 +    ls += [(x, h)] +ls.sort(key=lambda x: x[0]) +deq = deque([]) -deq = deque([]) -for x, h in Monsters: -    while deq and x > deq[0][0]: -        lim, dam = deq.popleft() -        acc -= dam -    c = max(0, h - acc) -    ans += c -    acc += c -    if c: -        deq += [(x + 2 * D, c)] +for i in range(N): +    x, h = ls[i] +    while deq and deq[0][0] < x: +        y, d = deq.popleft() +        acc -= d +    n = max(0, h - acc) +    ans += n +    acc += n +    if n: +        deq += [(x + 2 * D, n)]