program main
	implicit none
    integer N, K
	read(*, *) N, K
	if(N == K) then
		write(*, *) 1
	else if(mod(N-K,K-1) == 0) then
		write(*, *) (N-K)/(K-1) + 1
	else
		write(*, *) (N-K)/(K-1) + 2
	end if
end program main