#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <typename T>
void debug(T first) {
  cout << first << "\n";
}
template <typename T, typename... Args>
void debug(T first, Args... args) {
  cout << first << " ";
  debug(args...);
}
long long read_ll() {
  char c = getchar();
  while ((c < '0' || c > '9') && c != '-') c = getchar();
  long long ret = 0;
  int neg = 0;
  if (c == '-') neg = 1, c = getchar();
  while (c >= '0' && c <= '9') {
    ret = 10 * ret + c - 48;
    c = getchar();
  }
  return neg ? -ret : ret;
}
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  int minpos = -1;
  for (int i = 0; i <= n - 1; i++) {
    cin >> a[i];
    if (a[i] == 1) minpos = i;
  }
  int cnt = 0, i = minpos;
  if (k == n) return !printf("1");
  if (k > n / 2) return !printf("2");
  while (i > 0) {
    cnt++;
    if (k > minpos + 1) {
      i = k;
      break;
    }
    i -= (k - 1);
  }
  if (i <= 0) i = minpos;
  while (i < n - 1) {
    cnt++;
    i += (k - 1);
  }
  cout << cnt;
  return 0;
}
