#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, k;
  cin >> n >> k;
  int t = n;
  int ans = 1;
  if (n == k) {
    cout << ans << endl;
    return 0;
  }
  t -= k;
  while (true) {
    if (t <= 0) {
      cout << ans << endl;
      return 0;
    } else {
      t -= k - 1;
      ans++;
    }
  }
}
