program minimize
  implicit none 
  integer(8) :: n, k, ans
  read *, n, k
  if (mod(n-1,k-1) == 0) then
    ans = (n-1)/(k-1)
  else
    ans = (n-1)/(k-1)+1
  end if
  print '(i0)', ans
  stop
end program minimize