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

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

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

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

    num = 0
    
    do i=1,n
        num = num + h(i)/a
        if (mod(h(i),a) /= 0) num = num + 1

        where (x < x(i)+2*d )
            h = max(h-num*a, 0)
        end where

        if (sum(h) == 0) exit
    end do

    print*, num

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