#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, k;
  int a[200000];
  cin >> n >> k;
  int j;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] == 1) j = i;
  }
  if (k <= j && n - k >= j) {
    cout << ceil((double)(j + 1) / (k - 1)) + ceil((double)(n - j) / (k - 1))
         << endl;
  } else {
    cout << ceil((double)(n - 1) / (k - 1)) << endl;
  }
}
