import Data.List
import Debug.Trace

main = do
  [n, k] <- map read . words <$> getLine :: IO [Int]
  as <- map read . words <$> getLine :: IO [Int]
  print $ solve n k as

solve n k as =
--  traceShow (l,r) $ 
  ans
  where
    (l,r) = span (>1) as
    lenl = length l
    lenr = length r
    ans = solve_ (lenl+1) k + solve_ lenr k
    solve_ len k =
      div len (k-1) + if mod len k > 0 then 1 else 0
