import sys
N, K = map(int,input().split())
A = list(map(int, input().split()))
if N == K:
    print(1)
    sys.exit()
idx = A.index(1)
res = 0
if idx <= K:
    idx = K-1
    res = 1
else:
    while(True):
        res += 1
        idx -= K - 1
        if idx <= 0:
            break
idx = A.index(1)
if idx <= K:
    idx = K-1
while(True):
    if idx >= N-1:
        break
    res += 1
    idx += K-1

print(res)
