#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> v;
  int o = 0;
  for (int i = 0; i < (n); i++) {
    int a;
    cin >> a;
    v.push_back(a);
    if (a == 1) {
      o = i;
    }
  }
  int ans = o / (k - 1);
  if (o % (k - 1) != 0) {
    ans++;
    o = (k - 1 - o % (k - 1)) + o;
  }
  int ans2 = (n - o - 1) / (k - 1);
  if ((n - o - 1) % (k - 1) != 0) {
    ans2++;
  }
  cout << ans + ans2 << endl;
}
