#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9 + 7;
using LL = long long;
const LL LINF = 1e18;
using namespace std;
class PalseError {};
class Edge {
 public:
  int from, to, value;
  Edge(int a, int b, int c) {
    from = a;
    to = b;
    value = c;
  }
  Edge(int a, int b) {
    from = a;
    to = b;
  }
};
int main() {
  int(N);
  cin >> (N);
  int(K);
  cin >> (K);
  vector<int> vec;
  int iti;
  for (int a = 0; a < (N); ++a) {
    int(b);
    cin >> (b);
    if (b == 1) iti = a;
    vec.push_back(b);
  }
  LL ans = 0;
  int amari = 0;
  ans += (iti % (K - 1) == 0 ? iti / (K - 1) : iti / (K - 1) + 1);
  amari += iti % (K - 1);
  iti++;
  ans += ((N - iti) % (K - 1) == 0 ? (N - iti) / (K - 1)
                                   : (N - iti) / (K - 1) + 1);
  amari += (N - iti) % (K - 1);
  ans -= amari / (K);
  cout << (ans) << endl;
  return 0;
}
