import std.functional,
       std.algorithm,
       std.container,
       std.typetuple,
       std.typecons,
       std.bigint,
       std.string,
       std.traits,
       std.array,
       std.range,
       std.stdio,
       std.conv;

void main() {
  int[] NK = readln.chomp.split.to!(int[]);
  int N = NK[0],
      K = NK[1];
  int[] A = readln.chomp.split.to!(int[]);

  size_t p;
  foreach (i, a; A) {
    if (a == 1) {
      p = i;
      break;
    }
  }

  size_t g;

  for (;;) {
    if (g * (K - 1) <= p && p <= (g + 1) * (K - 1)) {
      break;
    }
    g++;
  }

  size_t ans;

  foreach_reverse (i; 0..g+1) {
    ans++;
    foreach (j; 0..K) {
      A[i * (K - 1) + j] = 1;
    }
  }

  import std.math;
  foreach (i; g+1..ceil((N.to!real-1f)/(K.to!real-1f) - 1f)+1) {
    ans++;
    foreach (j; 0..K) {
      A[N - K + j] = 1;
    }
  }

  writeln(ans);
}
