function Main(input) {
	input = input.trim();
	var n = Number(input[0]);
	var k = Number(input[2]);
	if(n == k){
		console.log(1);
	} else {
		var ret = n/(k-1);
		if(n%(k-1) > 0){
			ret++;
		}
		console.log(ret);
	}
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));