#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  int num[n];
  for (int i = 0; i < n; i++) cin >> num[i];
  int p = min_element(num, num + n) - num;
  int s = (p - 1 + k - 2) / (k - 1);
  s += (n - p + k - 2) / (k - 1);
  cout << s;
  return 0;
}
