#include <bits/stdc++.h>
using namespace std;
int main() {
  clock_t tStart = clock();
  long long n;
  scanf("%lld", &n);
  long long k;
  scanf("%lld", &k);
  long long arr[n];
  long long pos = -1;
  for (int i = 0; i < n; i++) {
    scanf("%lld", &arr[i]);
    if (arr[i] == 1) pos = i;
  }
  if (k >= n) {
    cout << "1" << endl;
    return 0;
  }
  long long left = pos;
  long long right = n - pos - 1;
  long long ans = 0;
  if (left >= 1) {
    ans += left / (k - 1);
    ans += left % (k - 1) == 0 ? 0 : 1;
  }
  if (right >= 1) {
    ans += right / (k - 1);
    ans += right % (k - 1) == 0 ? 0 : 1;
  }
  printf("%lld\n", ans);
  return 0;
}
