#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, K, x, ans;
  cin >> N >> K;
  vector<int> a(N);
  for (int i = 0; i < N; i++) {
    cin >> a.at(i);
    if (a.at(i) == 1) x = i;
  }
  ans = (x - 2) / (K - 1) + (N - K - 1) / (K - 1) + 2;
  cout << ans << endl;
}
