#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
void c_p_c() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int32_t main() {
  long long n, k, pos = -1;
  cin >> n >> k;
  long long a[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] == 1) {
      pos = i;
    }
  }
  if (k >= n) {
    cout << 1 << endl;
  } else {
    long long rem = n - pos - 1;
    cout << ((rem / (k - 1) + rem % (k - 1)) + 1);
  }
  return 0;
}
