#include <bits/stdc++.h>
using namespace std;
int main() {
  int k, n, flag, answer = 0, dummy;
  cin >> n;
  cin >> k;
  for (int i = 0; i < n; ++i) {
    cin >> dummy;
    if (dummy == 1) {
      flag = i + 1;
    }
  }
  --k;
  answer += (flag - 1) / k;
  if ((flag - 1) % k != 0) {
    ++answer;
  }
  answer += (n - flag) / k;
  if ((n - flag) % k != 0) {
    ++answer;
  }
  cout << answer << endl;
  return 0;
}
