import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

int calc(int k, int[] xs) {
   int p = 0;
   for (int i = 0; i < xs.length; i++) {
       if (xs[i] == 1) {
           p = i;
           break;
       }
   }

   int ans = 0;
   int x = p;
   while (x-1 >= 0) {
       ans++;
       x -= k + 1;
   }

   x = p;
   while (x+1 < xs.length) {
       ans++;
       x += k - 1;
   }
   return ans;
}

void main() {
    auto nk = readints;
    int k = nk[1];
    auto xs = readints;

    auto ans = calc(k, xs);
    writeln(ans);
}