import Control.Applicative
import Data.List

getInt :: IO Int
getInt = (\a -> read a :: Int) <$> getLine

getInteger :: IO Integer
getInteger = (\a -> read a :: Integer) <$> getLine

getListInt :: IO [Int]
getListInt = ((map (\a -> read a :: Int)) . words) <$> getLine

getListInteger :: IO [Integer]
getListInteger = ((map (\a -> read a :: Integer)) . words) <$> getLine

findOne :: [Integer] -> Integer
findOne [] = 0
findOne (1:res) = 1
findOne (_:res) = 1 + findOne res

count :: Integer -> Integer -> Integer -> Integer
count n k a = 
    let others = n - 1
        in (div others (k - 1)) + (if 0 == mod others (k - 1) then 0 else 1)

main = do
    [n, k] <- getListInteger
    a <- findOne <$> getListInteger
    --print $ ((div (a - 1) (k - 1)) + (if 0 == mod (a - 1) (k - 1) then 0 else 1)) + (div (n - a) (k - 1) + (if 0 == mod (n - a) (k - 1) then 0 else 1))
    print $ count n k a
