#include <bits/stdc++.h>
using namespace std;
int A[101010];
int main(void) {
  int N, K;
  scanf("%d %d", &N, &K);
  int p = -1, min = 101010;
  for (int i = 0; i < N; ++i) {
    scanf("%d", A + i);
    if (A[i] < min) {
      min = A[i];
      p = i;
    }
  }
  int left = 1 + ceil((double)max(p - K + 1, 0) / (K - 1));
  int right = p == N - 1 ? 0 : 1 + ceil((double)max(N - (p + K), 0) / (K - 1));
  if (N == K) right = 0;
  if (p < K) {
    right = ceil((double)max(N - (K), 0) / (K - 1));
  }
  printf("%d\n", left + right);
  return 0;
}
