#include <bits/stdc++.h>
using namespace std;
typedef struct data {
  int now;
  int cost;
} data;
int nw[9] = {0, 1, 0, -1, -1, 1, 1, -1, 0};
int nh[9] = {1, 0, -1, 0, 1, 1, -1, -1, 0};
int n, k, a[100001];
int main() {
  int mini;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (a[i] == 1) mini = i;
  }
  if (mini <= k || mini > n - k) {
    n -= k;
    cout << 1 + n / (k - 1) + (n % (k - 1) ? 1 : 0) << endl;
  } else {
    int left = mini - (k - 1) / 2 - 1, right = n - (mini + (k - 1) / 2);
    cout << 1 + left / (k - 1) + (left % (k - 1) ? 1 : 0) + right / (k - 1) +
                (right % (k - 1) ? 1 : 0)
         << endl;
  }
  return 0;
}
