var input = "";
process.stdin.resume();
process.stdin.setEncoding("utf8");
process.stdin.on("data", (chunk) => {
  input += chunk;
});
process.stdin.on("end", () => {
  input = input.split("\n");
  main();
});

function main(){
    const nums = input[0].split(" ");
    const N = Number(nums[0]);
    const K = Number(nums[1]); 
    console.log(Math.ceil( (N-K) / (K-1) ) + 1);
}