#include <bits/stdc++.h>
int main(int argc, char *argv[]) {
  int K, N, min;
  int i;
  int j = 1;
  int array[100000];
  char buf[256];
  char num[10];
  scanf("%d %d", &K, &N);
  K = K - N;
  while (K >= 1) {
    K = K - (N - 1);
    j++;
  }
  printf("%d", j);
}
