#include <bits/stdc++.h>
using namespace std;
using P = pair<int, int>;
int main() {
  ifstream in("4.txt");
  cin.rdbuf(in.rdbuf());
  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  int mini = 100001;
  int ite;
  for (int i = 0; i < (int)(n); i++) {
    cin >> a[i];
    if (a[i] == 1) ite = i;
  }
  if (n <= k) {
    cout << 1;
    return 0;
  }
  int cnt = 0;
  if (ite % (k - 1) == 0)
    cnt += ite / (k - 1);
  else {
    cnt += ite / (k - 1);
    cnt++;
  }
  n--;
  if (ite + 1 >= k) {
    if ((n - ite - 1) % (k - 1) == 0)
      cnt += (n - ite - 1) / (k - 1);
    else {
      cnt += (n - ite - 1) / (k - 1);
      cnt++;
    }
  } else {
    if (ite == 0) cnt++;
    if ((n - k - 1) % k == 0)
      cnt += (n - k - 1) / (k - 1);
    else {
      cnt += (n - k - 1) / (k - 1);
      cnt++;
    }
  }
  cout << cnt << endl;
  return (0);
}
