// A: LCM
// NG
'use strict';
const inputRaw = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");

const INPUT_SETTINGS_INDEX = 0;
const INPUT_LIST_INDEX = 1;
const INPUT_SETTINGS_N_INDEX = 0;
const INPUT_SETTINGS_K_INDEX = 1;
const INPUT_DELIMITER = " ";

const inputSettings = inputRaw[INPUT_SETTINGS_INDEX].split(INPUT_DELIMITER);
const N = inputSettings[INPUT_SETTINGS_N_INDEX];
const K = inputSettings[INPUT_SETTINGS_K_INDEX];
const inputList = inputRaw[INPUT_LIST_INDEX].split(INPUT_DELIMITER);

const process = (N, K) => {
  let count = 0;
  let currentIndex = 0;

  while (currentIndex < N) {
    currentIndex+=K-1;
    count++;
  }

  return Math.floor(N/(K-1));
};

console.log(process(N, K));