#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  int num;
  cin >> n >> k;
  if ((n - k) % (k - 1) == 0) {
    num = (n - k) / (k - 1) + 1;
  } else {
    num = (n - k) / (k - 1) + 2;
  }
  printf("%d", num);
  return 0;
}
