#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, K;
  cin >> N >> K;
  int cnt = 0, ans;
  while (cnt < N) {
    if (cnt == 0)
      cnt += K;
    else
      cnt += K - 1;
    ans++;
  }
  cout << ans << endl;
}
