solve :: Int -> Int -> [Int] -> Int
solve _ _ [] = 0
solve _ _ (_:[]) = 0
solve n k (a:b:rs)
  | a == b = solve n k (b:rs)
  | n <= k = 1
  | otherwise = 1 + solve (n - k + 1) k ((minimum (take k array)):(drop k array))
  where
    array = a:b:rs

main :: IO ()
main = do
  s1 <- getLine
  s2 <- getLine
  let n:k:_ = map (\x -> read x :: Int) $ words s1
      array = map (\x -> read x :: Int) $ words s2
  print $ solve n k array
