'use strict'

function main(s) {

  s = s.split('\n');

  const N = Number(s[0].split(' ')[0]);
  const K = Number(s[0].split(' ')[1]);

  let ans = 0;

  if (N <= K) ans = 1;
  if (N > K) ans = Math.ceil((N - K) / (K - 1)) + 1;

  console.log(ans);
}

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