import sys

sys.setrecursionlimit(10 ** 7)



sr = lambda: sys.stdin.readline().rstrip()

ir = lambda: int(sr())

lr = lambda: list(map(int, sr().split()))



def main():

    N, D, A = lr()

    XH = [lr() for _ in range(N)]

    XH.sort()



    over = [N] * N # over[i]はi番目のモンスターを攻撃した時影響のないモンスターの最小値（最大はNで対象なし）

    cur = 1

    for i in range(N):

        while cur < N and XH[i][0] + D + D >= XH[cur][0]:

            cur += 1

        over[i] = cur



    damage = 0 # 今までの累計のダメージ数　(影響のないダメージは引く)

    reset = [0] * (N+1) # これ以降関係のないダメージ

    answer = 0

    for i in range(N):

        x, h = XH[i]

        damage -= reset[i]

        h -= damage

        if h > 0:

            time = (h+A-1)//A

            answer += time

            damage += A * time

            reset[over[i]] += A * time



    print(answer)



if __name__ == "__main__":

    main()
import sys

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines



def main():

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

    m = list(map(int,read().split()))

    X,H = list(zip(*sorted(zip(m,m))))

    

    over = [-1]*N

    tmp=0

    for i in range(N):

      while(tmp<N and X[i]+D*2>=X[tmp]):

        tmp += 1

      over[i] = tmp

    reset = [0]*N

    

    ans = 0

    dam = 0

    for i in range(N):

      if i>0:

        reset[i] += reset[i-1]

      hp = H[i]-dam+reset[i]

      if hp > 0:

        bomb = (hp+A-1)//A

        ans += bomb

        dam += bomb * A

        if(over[i]<N):

          reset[over[i]] += bomb * A



    print(ans)



if __name__ == "__main__":

    main()

import sys

sys.setrecursionlimit(10**7)
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))


def main():
    N, D, A = lr()
    XH = [lr() for _ in range(N)]
    XH.sort()
    over = [N] * N  # over[i]はi番目のモンスターを攻撃した時影響のないモンスターの最小値（最大はNで対象なし）
    cur = 1
    for i in range(N):
        while cur < N and XH[i][0] + D + D >= XH[cur][0]:
            cur += 1
        over[i] = cur
    damage = 0  # 今までの累計のダメージ数　(影響のないダメージは引く)
    reset = [0] * (N + 1)  # これ以降関係のないダメージ
    answer = 0
    for i in range(N):
        x, h = XH[i]
        damage -= reset[i]
        h -= damage
        if h > 0:
            time = (h + A - 1) // A
            answer += time
            damage += A * time
            reset[over[i]] += A * time
    print(answer)


if __name__ == "__main__":
    main()

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


def main():
    N, D, A = list(map(int, readline().split()))
    m = list(map(int, read().split()))
    X, H = list(zip(*sorted(zip(m, m))))
    over = [-1] * N
    tmp = 0
    for i in range(N):
        while tmp < N and X[i] + D * 2 >= X[tmp]:
            tmp += 1
        over[i] = tmp
    reset = [0] * N
    ans = 0
    dam = 0
    for i in range(N):
        if i > 0:
            reset[i] += reset[i - 1]
        hp = H[i] - dam + reset[i]
        if hp > 0:
            bomb = (hp + A - 1) // A
            ans += bomb
            dam += bomb * A
            if over[i] < N:
                reset[over[i]] += bomb * A
    print(ans)


if __name__ == "__main__":
    main()

-sys.setrecursionlimit(10**7) -sr = lambda: sys.stdin.readline().rstrip() -ir = lambda: int(sr()) -lr = lambda: list(map(int, sr().split())) +read = sys.stdin.buffer.read +readline = sys.stdin.buffer.readline +readlines = sys.stdin.buffer.readlines -    N, D, A = lr() -    XH = [lr() for _ in range(N)] -    XH.sort() -    over = [N] * N  # over[i]はi番目のモンスターを攻撃した時影響のないモンスターの最小値（最大はNで対象なし） -    cur = 1 +    N, D, A = list(map(int, readline().split())) +    m = list(map(int, read().split())) +    X, H = list(zip(*sorted(zip(m, m)))) +    over = [-1] * N +    tmp = 0 -        while cur < N and XH[i][0] + D + D >= XH[cur][0]: -            cur += 1 -        over[i] = cur -    damage = 0  # 今までの累計のダメージ数　(影響のないダメージは引く) -    reset = [0] * (N + 1)  # これ以降関係のないダメージ -    answer = 0 +        while tmp < N and X[i] + D * 2 >= X[tmp]: +            tmp += 1 +        over[i] = tmp +    reset = [0] * N +    ans = 0 +    dam = 0 -        x, h = XH[i] -        damage -= reset[i] -        h -= damage -        if h > 0: -            time = (h + A - 1) // A -            answer += time -            damage += A * time -            reset[over[i]] += A * time -    print(answer) +        if i > 0: +            reset[i] += reset[i - 1] +        hp = H[i] - dam + reset[i] +        if hp > 0: +            bomb = (hp + A - 1) // A +            ans += bomb +            dam += bomb * A +            if over[i] < N: +                reset[over[i]] += bomb * A +    print(ans)