#include <bits/stdc++.h>
using namespace std;
template <typename T>
void show(vector<T> &vec) {
  for (auto value : vec) {
    cout << value << " ";
  }
  cout << endl;
}
int main() {
  int n, k;
  cin >> n >> k;
  cout << ceil(double(n - 1) / double(k - 1));
  return 0;
}
