import sys

import math

N,K=list(map(int,input().split()))

A=[int(i) for i in input().split()]

a=0

for i in range(N):

    if A[i]==1:

        a=i

        break

if a <=K-1:

    print((math.ceil((N-K)/(K-1))+1))

    sys.exit()

if N-K<=a:

    print((math.ceil((N-K)/(K-1))+1))

    sys.exit()

print((math.ceil((N-K)/(K-1))+1))
import math

N,K=list(map(int,input().split()))

A=[int(i) for i in input().split()]

print((math.ceil((N-K)/(K-1))+1))
import sys
import math

N, K = list(map(int, input().split()))
A = [int(i) for i in input().split()]
a = 0
for i in range(N):
    if A[i] == 1:
        a = i
        break
if a <= K - 1:
    print((math.ceil((N - K) / (K - 1)) + 1))
    sys.exit()
if N - K <= a:
    print((math.ceil((N - K) / (K - 1)) + 1))
    sys.exit()
print((math.ceil((N - K) / (K - 1)) + 1))

import math

N, K = list(map(int, input().split()))
A = [int(i) for i in input().split()]
print((math.ceil((N - K) / (K - 1)) + 1))

-import sys -a = 0 -for i in range(N): -    if A[i] == 1: -        a = i -        break -if a <= K - 1: -    print((math.ceil((N - K) / (K - 1)) + 1)) -    sys.exit() -if N - K <= a: -    print((math.ceil((N - K) / (K - 1)) + 1)) -    sys.exit()