main = do
    [n,k] <- ((fmap read . words) <$> getLine) :: IO [Int]
    _ <- getLine
    if k==2
        then print $ n-1
        else if n`mod`(k-1)==1
            then print $ n `div` (k-1)
            else print $ ceiling $ fromIntegral n/fromIntegral (k-1)
