module Main where

import Control.Applicative
import Control.Monad
import qualified Data.ByteString.Char8 as B
import Data.List (unfoldr, break)

readInts :: B.ByteString -> [Int]
readInts bs = unfoldr (B.readInt . B.dropWhile (== ' ')) bs

main :: IO ()
main = do
    [n, k] <- readInts <$> B.getLine
    -- as <- readInts <$> B.getLine
    B.getLine
    print $ (n - 1 + k - 1 - 1) `div` (k - 1)