import Data.List

solve :: Int -> Int -> Int
solve n k = ceiling $ fromIntegral (n - 1) / fromIntegral (k - 1)

main :: IO ()
main = do
  [n, k] <- map read . words <$> getLine
  _ <- getLine
  print $ solve n k