n, k = map(int, input().split())
A = [int(x) for x in input().split()]
i1 = A.index(1)
ans = 0
tmp = i1
while True:
    if tmp <= 0:
        break
    tmp -= k - 1
    ans += 1
tmp = i1
while True:
    if n - 1 <= tmp:
        break
    tmp += k - 1
    ans += 1
print(ans)
