import math

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

l=[]

for i in range(N):

  k=list(map(int,input().split()))

  l.append(k)

l.sort()

S=[0]*N

ma=[0]*N

tmp=N-1

for i in reversed(list(range(N))):

  x=l[i][0]

  for j in reversed(list(range(0,tmp))):

    if abs(l[j][0]-(x-D))>D:

      ma[i]=j+1

      tmp=j+1

      break

  else:

    ma[i]=0

    tmp=0

ans=0

S[0]=math.ceil(l[0][1]/A)

for i in range(1,N):

  h=l[i][1]

  left=S[ma[i]-1] if ma[i]>0 else 0

  right=S[i-1]

  sum_=(right-left)*A

  if h<=sum_:

    S[i]=S[i-1]

    continue

  time=math.ceil((h-sum_)/A)

  S[i]=time+S[i-1]

print((S[N-1]))
import math

from operator import itemgetter

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

l=[]

for i in range(N):

  k=tuple(map(int,input().split()))

  l.append(k)

l.sort(key=itemgetter(0))

S=[0]*N

ma=[0]*N

tmp=N-1

for i in reversed(list(range(N))):

  x=l[i][0]

  for j in reversed(list(range(0,tmp))):

    if abs(l[j][0]-(x-D))>D:

      ma[i]=j+1

      tmp=j+1

      break

  else:

    ma[i]=0

    tmp=0

ans=0

S[0]=math.ceil(l[0][1]/A)

for i in range(1,N):

  h=l[i][1]

  left=S[ma[i]-1] if ma[i]>0 else 0

  right=S[i-1]

  sum_=(right-left)*A

  if h<=sum_:

    S[i]=S[i-1]

    continue

  time=math.ceil((h-sum_)/A)

  S[i]=time+S[i-1]

print((S[N-1]))
import math

N, D, A = list(map(int, input().split()))
l = []
for i in range(N):
    k = list(map(int, input().split()))
    l.append(k)
l.sort()
S = [0] * N
ma = [0] * N
tmp = N - 1
for i in reversed(list(range(N))):
    x = l[i][0]
    for j in reversed(list(range(0, tmp))):
        if abs(l[j][0] - (x - D)) > D:
            ma[i] = j + 1
            tmp = j + 1
            break
    else:
        ma[i] = 0
        tmp = 0
ans = 0
S[0] = math.ceil(l[0][1] / A)
for i in range(1, N):
    h = l[i][1]
    left = S[ma[i] - 1] if ma[i] > 0 else 0
    right = S[i - 1]
    sum_ = (right - left) * A
    if h <= sum_:
        S[i] = S[i - 1]
        continue
    time = math.ceil((h - sum_) / A)
    S[i] = time + S[i - 1]
print((S[N - 1]))

import math
from operator import itemgetter

N, D, A = list(map(int, input().split()))
l = []
for i in range(N):
    k = tuple(map(int, input().split()))
    l.append(k)
l.sort(key=itemgetter(0))
S = [0] * N
ma = [0] * N
tmp = N - 1
for i in reversed(list(range(N))):
    x = l[i][0]
    for j in reversed(list(range(0, tmp))):
        if abs(l[j][0] - (x - D)) > D:
            ma[i] = j + 1
            tmp = j + 1
            break
    else:
        ma[i] = 0
        tmp = 0
ans = 0
S[0] = math.ceil(l[0][1] / A)
for i in range(1, N):
    h = l[i][1]
    left = S[ma[i] - 1] if ma[i] > 0 else 0
    right = S[i - 1]
    sum_ = (right - left) * A
    if h <= sum_:
        S[i] = S[i - 1]
        continue
    time = math.ceil((h - sum_) / A)
    S[i] = time + S[i - 1]
print((S[N - 1]))

+from operator import itemgetter -    k = list(map(int, input().split())) +    k = tuple(map(int, input().split())) -l.sort() +l.sort(key=itemgetter(0))