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;

int repL(int[] A, int K, int c = 0) {
  if (A.length == 1) {
    return c;
  }
  if (A.length <= K) {
    return c + 1;
  } else {
    return repL(A[0..$-K+1], K, c + 1);
  }
}

int repR(int[] A, int K, int c = 0) {
  if (A.length == 1) {
    return c;
  }
  if (A.length <= K) {
    return c + 1;
  } else {
    return repR(A[K-1..$], K, c + 1);
  }
}

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 idx;
  foreach (i, a; A) {
    if (a == 1) {
      idx = i;
      break;
    }
  }

  int ans1 = repL(A[0..idx+1], K),
      ans2 = repR(A[idx..$], K);

  writeln(ans1 + ans2);
}

