program minimization
    implicit none
    integer :: k=0,n=0,cnt=0,i=0
    integer, allocatable :: a(:)

    read(*,*)n,k
    allocate(a(n))
    read(*,*) (a(i),i=1,n)
    if(n<2 .or. 100000<n .or. k<2 .or. n<k)then
    else
        do
            n = n - (k-1)
            cnt = cnt + 1
            if(n<0)then
                goto 1
            else
            endif
        enddo
    endif
    
    1 continue
        if(.not. mod(n,k) == 0)then
            cnt = cnt - 1
        else
            cnt = cnt + 1
        endif
        write(*,*) cnt
    deallocate(a)

end program minimization