#include <bits/stdc++.h>
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  int a[n];
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  int b;
  for (int i = 0; i < n; i++) {
    if (a[i] == 1) {
      b = i;
    }
  }
  int c = 0;
  if (b != 0) {
    for (int i = 1;; i++) {
      c++;
      if (b <= (k - 1) * i) break;
    }
  }
  if (b != n - 1) {
    for (int i = 1;; i++) {
      c++;
      if (b + (k - 1) * i >= n - 1) break;
    }
  }
  printf("%d\n", c);
}
