function main(input) {
    var n = input[0].split(" ")[0]-0;
    var k = input[0].split(" ")[1]-0;
    console.log(~~(n/(k-1)));
}

main(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split("\n"));


