#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k, t, i;
  int min = 1000;
  int cnt = 0;
  int index = 0;
  bool flag;
  cin >> n >> k;
  vector<int> vec;
  for (i = 0; i < n; i++) {
    cin >> t;
    vec.push_back(t);
    if (min > t) {
      min = t;
      index = i;
    }
  }
  for (i = index; i > -1; i -= k - 1) {
    flag = false;
    for (int j = i; j >= i - k && j > -1; j--) {
      if (vec[j] > min) {
        vec[j] = min;
        flag = true;
      }
    }
    if (flag) cnt++;
  }
  for (i = index; i < vec.size(); i += k - 1) {
    flag = false;
    for (int j = i; j < i + k && j < vec.size(); j++) {
      if (vec[j] > min) {
        vec[j] = min;
        flag = true;
      }
    }
    if (flag) cnt++;
  }
  cout << (n - 1) / (k - 1) << endl;
}
