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