// 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 findMinAndIndex = intList =>
  intList.reduce((acc, curr, index) => (curr < acc ? curr : acc), {
    item: intList[0],
    index: 0,
  });

const process = (N, K, inputList) => {
  let count = 0;
  let currentIndex = 0;
  const { min, index } = findMinAndIndex(inputList);

  if (N > 2*K) {
    if (index > K-1 || index < N-K) {
      return Math.floor(N / (K - 1)) + 2;
    } else {
      Math.floor(N / (K - 1));
    }
  } else {
    return Math.floor(N / (K - 1));
  }
};

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