function main(input) {
    var n = input[0].split(" ")[0]-0;
    var k = input[0].split(" ")[1]-0;
    var ans = 0;
    for(var i=1;i<n;i+=k-1) {ans++;}
    console.log(ans);
}

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


//1 2 3 4 5 6
