#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int a[n], one;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] == 1) one = i;
  }
  int count = 0;
  int left = one;
  int right = n - one - 1;
  if (k == n) {
    cout << 1 << endl;
    return 0;
  }
  if ((right <= k - 1) && (right != 0)) {
    left -= (k - right - 1);
    right = 0;
    count++;
    count += (left / (k - 1));
    if ((left % (k - 1) != 0) && (left > 0)) count++;
    cout << count << endl;
  } else if ((left <= k - 1) && (left != 0)) {
    right -= (k - left - 1);
    left = 0;
    count++;
    count += (right / (k - 1));
    if ((right % (k - 1) != 0) && (right > 0)) count++;
    cout << count << endl;
  } else {
    int mod = left % (k - 1);
    count += (left / (k - 1));
    if (mod != 0) {
      right -= k - mod - 1;
      count++;
    }
    count += (right / (k - 1));
    if (right % (k - 1) != 0) count++;
    cout << count << endl;
  }
  return 0;
}
