program main
    implicit none
    integer(8):: n, d, a, i, j, num, tot
    integer(8), allocatable:: x(:), h(:), lenge(:)
    integer(8), parameter:: one = 1

    read*, n, d, a
    allocate(x(n), h(n), lenge(n))

    do i = 1, n
        read*, x(i), h(i)
    end do

    ! x(:) = [(i*1000, i=1,n)]
    ! h(:) = [(i*1000, i=1,n)]


    call marge_sort(x(:), h(:), one, n)

    i = 1
    j = 0
    do while(j < n)
        j = j+1
        if (x(j) - x(i) > 2*d)then
            lenge(i) = j-1
            i = i+1
        end if
    end do
    lenge(i:) = j
    tot = 0

    do i = 1, n
        if (h(i) == 0) cycle
        num = h(i)/a
        if (mod(h(i),a) /= 0) num = num+1
        do j=i,lenge(i)
            h(j) = max(h(j)-num*a, 0)
        end do
        tot = tot + num
    end do

    print*, tot

contains

recursive subroutine marge_sort(x,h, first, last)
    integer(8):: x(:), h(:), first, last
    integer(8):: tmp, mean

    if (last-first <= 1) then
        if (x(last) < x(first)) then
            tmp = x(last)
            x(last) = x(first)
            x(first) = tmp

            tmp = h(last)
            h(last) = h(first)
            h(first) = tmp            
        end if

    else
        mean = (first+last)/2
        call marge_sort(x(:), h(:), first, mean)
        call marge_sort(x(:), h(:), mean+1, last)
        call marge(x(:), h(:), first, mean, last)

    end if
end subroutine


subroutine marge(x,h,first,mean,last)
    integer(8):: x(:), h(:), first, mean, last
    integer(8), allocatable:: tmpx(:), tmph(:)
    integer(8):: r, l, i

    allocate(tmpx(last-first+1), tmph(last-first+1))
    r = first
    l = mean + 1
    i = 1

    do while(r <= mean .and. l <= last)
        if (x(r) <= x(l)) then
            tmpx(i) = x(r)
            tmph(i) = h(r)
            i = i+1
            r = r+1
        else
            tmpx(i) = x(l)
            tmph(i) = h(l)
            i = i+1
            l = l+1
        end if
    end do

    if (r > mean)then
        tmpx(i:) = x(l:last)
        tmph(i:) = h(l:last)
    else
        tmpx(i:) = x(r:mean)
        tmph(i:) = h(r:mean)
    end if

    x(first:last) = tmpx(:)
    h(first:last) = tmph(:)
    
end subroutine
end program main