program name
    use,intrinsic :: iso_fortran_env
    implicit none
    integer(int64):: n,c,k,i,d_buss,cnt,notteru
    integer(int64), allocatable:: t(:)

    read*, n,c,k
    allocate(t(n))
    do i=1,n
        read*, t(i)
    end do
    d_buss=0
    cnt=1
    notteru=0
    do i=1,n
        if (d_buss < t(i)) then
            d_buss=t(i)+k
            cnt=cnt+1
            notteru=0
        else
            if (notteru > c) then
                d_buss=t(i)+k
                cnt=cnt+1
                notteru=0
            end if
        end if
        notteru=notteru+1
    end do
    print'(i0)', cnt
end program name