program sample
    implicit none
  
    integer(8) :: i,j,m,n,a,b,c,k
    integer(8),allocatable :: x(:),y(:)
  
    read(*,*) n,k
    a=(n-1)/(k-1)
    if(mod(n-1,k-1)/=0)then
        a=a+1
    end if
  	write(*,*)a
    stop
end program sample
  

