function main(input) {
  var args = input.split('\n');
  var N = parseInt(args[0][0], 10);
  var K = parseInt(args[0][2], 10);
    
  console.log(1+Math.ceil((N-K)/(K-1)));
}

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