let () =
  let n, k = Scanf.scanf "%d %d" (fun n k -> n, k) in
  let a =
    Array.init n (fun _ ->
        Scanf.scanf " %d" (fun x -> x)) in
  let (_, i1) = Array.fold_left (fun (i, res) x ->
               if x = 1 then
                 (i+1, res)
               else
                 (i+1, res)
             ) (0, 0) a in
  Printf.printf "%d\n"
    (if i1 = 0 then
       (n) / (k-1)
     else if i1 < k then
      1 + (n-i1) / (k-1)
    else
      2 + (i1) / (k-1) + (n-i1)/(k-1))
