'use strict'

function Main(input) {
  const N = Number(input.split('\n')[0].split(' ')[0]);
  const K = Number(input.split('\n')[0].split(' ')[1]);
  let answer = 1 + Math.ceil((N-K)/(K-1));

  console.log(answer);

}

Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());