import std.algorithm;
import std.container;
import std.conv;
import std.functional;
import std.math;
import std.meta;
import std.random;
import std.range;
import std.stdio;
import std.string;
import std.traits;
import std.typecons;


void main() {
  mixin(readAsInto!(int, "N, K"));
  auto A = readln.chomp.split.to!(int[]);

  ceil((N - 1).to!float / (K - 1)).writeln;
}


string readAsInto(T, string D)() {
  return
    T.stringof ~ " " ~ D ~ ";"
  ~ "foreach(tup; zip("
    ~ "[" ~ (D.split(",").map!(s => "&" ~ s.strip).join(",")) ~ "],"
    ~ "readln.chomp.split.to!(" ~ T.stringof ~ "[])"
  ~ ")) *tup[0] = tup[1];";
}
