open Batteries
open Printf
let () =
  let n,k = Scanf.scanf "%d %d " (fun a b -> a,b) in
  let a_arr = Array.init n (fun _ -> Scanf.scanf "%d " (fun a -> a)) in
  
  let rec aux i res =
    let res = (k-1) * i + 1 in
    if n <= res then i else
      aux (i+1) res
  in

  Printf.printf "%d\n" @@ aux 1 0
