import Data.List
import Data.Maybe 
import qualified Data.ByteString.Char8 as B

main = do
  [n, k] <- map (fst . fromJust . B.readInt) . B.words <$> B.getLine 
  getLine
  print $ if (n <= k) then 1 else (ceiling $ (fromIntegral n) / (fromIntegral (k - 1)))