var main = function(s) {
  s=s.split('\n');
  var A = s[0];
  var B = A.split(' ');
	var	N = parseInt(B[0]);
    var K = parseInt(B[1]);
    N = N-K;
  	var count = 1;
  	while(0<N){
      N = N-(K-1);
      count++;
    }
  console.log(count);
    return 0; 
}

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