import Data.List
main :: IO()
main = do
  [n, k]<- map read . words <$> getLine
  vals <- map read . words <$> getLine
  print $ slv n k vals

slv :: Int -> Int -> [Int] -> Int
slv n k vals | length a >= k - 1 && length b - 1 >= k - 1 = m1val + m2val + d1 + d2
             | otherwise = d3 + m3val
  where minval = minimum vals
        (a, b) = span (/=minval) vals
        (d1, m1) = (length a) `divMod` (k - 1)
        (d2, m2) = (length b - 1) `divMod` (k - 1)
        (d3, m3) = (n - 1) `divMod` (k - 1)
        m1val | m1 /= 0 = 1
              | otherwise = 0
        m2val | m2 /= 0 = 1
              | otherwise = 0
        m3val | m3 /= 0 = 1
              | otherwise = 0