#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int ary[n];
  int index = 0;
  for (int i = 0; i < n; i++) {
    cin >> ary[i];
    if (ary[i] == 1) {
      index = ary[i];
    }
  }
  int kaisu = 0;
  if ((index + 1) % (k - 1) == 0) {
    kaisu += (index + 1) / (k - 1);
  } else {
    kaisu += (index + 1) / (k - 1);
    kaisu++;
  }
  if ((n - index) % (k - 1) == 0) {
    kaisu += (n - index) / (k - 1);
  } else {
    kaisu += (n - index) / (k - 1);
    kaisu++;
  }
  cout << kaisu - 1 << endl;
  return 0;
}
