n, k = io.read("*n", "*n")
minpos = 1
min = io.read("*n")
for i = 2, n do
  local a = io.read("*n")
  if(a < min) then min, minpos = a, i end
end
-- find min(s) where minpos - (k-1) * s <= 1
s = math.ceil((minpos - 1) / (k - 1))
-- find min(t) where n <= minpos + (k-1) * t
t = math.ceil((n - minpos) / (k - 1))
print(s + t)
