import bisect

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

fox = [None]*n

for i in range(n):

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

  fox[i] = (x, h)



fox.sort()

x = [int(fox[i][0]) for i in range(n)]

h = [int(fox[i][1]) for i in range(n)]



ans = 0

bit = [0]*n

for i in range(n):

  if i != 0:

    bit[i] += bit[i-1]

  if bit[i] >= h[i]:

    continue

  sub = (h[i]-bit[i]-1)//a+1

  ans += sub

  bit[i] += sub*a

  index = bisect.bisect_right(x, x[i]+2*d)

  if index == n:

    continue

  bit[index] -= sub*a

print(ans)
import sys

input = sys.stdin.readline





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

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



fox.sort()



sub = [0]*(n+1)



def bisect(x):

    l, r = 0, n

    while r-l > 1:

        k = (r+l)//2

        if fox[k][0] <= x:

            l = k

        else:

            r = k

    if fox[l][0] <= x:

        return l

    return r





def main():

    ans = 0

    

    for i in range(n):

        if i != 0:

            sub[i] += sub[i-1]

        if fox[i][1]-a*sub[i] <= 0:

            continue

        count = (fox[i][1]-sub[i]*a-1)//a+1

        ans += count

        sub[i] += count

        sub[bisect(fox[i][0]+2*d)+1] -= count



    print(ans)



    

if __name__ == "__main__":

    main()

import bisect

n, d, a = list(map(int, input().split()))
fox = [None] * n
for i in range(n):
    x, h = list(map(int, input().split()))
    fox[i] = (x, h)
fox.sort()
x = [int(fox[i][0]) for i in range(n)]
h = [int(fox[i][1]) for i in range(n)]
ans = 0
bit = [0] * n
for i in range(n):
    if i != 0:
        bit[i] += bit[i - 1]
    if bit[i] >= h[i]:
        continue
    sub = (h[i] - bit[i] - 1) // a + 1
    ans += sub
    bit[i] += sub * a
    index = bisect.bisect_right(x, x[i] + 2 * d)
    if index == n:
        continue
    bit[index] -= sub * a
print(ans)

import sys

input = sys.stdin.readline
n, d, a = list(map(int, input().split()))
fox = [list(map(int, input().split())) for _ in range(n)]
fox.sort()
sub = [0] * (n + 1)


def bisect(x):
    l, r = 0, n
    while r - l > 1:
        k = (r + l) // 2
        if fox[k][0] <= x:
            l = k
        else:
            r = k
    if fox[l][0] <= x:
        return l
    return r


def main():
    ans = 0
    for i in range(n):
        if i != 0:
            sub[i] += sub[i - 1]
        if fox[i][1] - a * sub[i] <= 0:
            continue
        count = (fox[i][1] - sub[i] * a - 1) // a + 1
        ans += count
        sub[i] += count
        sub[bisect(fox[i][0] + 2 * d) + 1] -= count
    print(ans)


if __name__ == "__main__":
    main()

-import bisect +import sys +input = sys.stdin.readline -fox = [None] * n -for i in range(n): -    x, h = list(map(int, input().split())) -    fox[i] = (x, h) +fox = [list(map(int, input().split())) for _ in range(n)] -x = [int(fox[i][0]) for i in range(n)] -h = [int(fox[i][1]) for i in range(n)] -ans = 0 -bit = [0] * n -for i in range(n): -    if i != 0: -        bit[i] += bit[i - 1] -    if bit[i] >= h[i]: -        continue -    sub = (h[i] - bit[i] - 1) // a + 1 -    ans += sub -    bit[i] += sub * a -    index = bisect.bisect_right(x, x[i] + 2 * d) -    if index == n: -        continue -    bit[index] -= sub * a -print(ans) +sub = [0] * (n + 1) + + +def bisect(x): +    l, r = 0, n +    while r - l > 1: +        k = (r + l) // 2 +        if fox[k][0] <= x: +            l = k +        else: +            r = k +    if fox[l][0] <= x: +        return l +    return r + + +def main(): +    ans = 0 +    for i in range(n): +        if i != 0: +            sub[i] += sub[i - 1] +        if fox[i][1] - a * sub[i] <= 0: +            continue +        count = (fox[i][1] - sub[i] * a - 1) // a + 1 +        ans += count +        sub[i] += count +        sub[bisect(fox[i][0] + 2 * d) + 1] -= count +    print(ans) + + +if __name__ == "__main__": +    main()