import math

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

A = list(map(int, input().split()))



assert isinstance(A,list)

a = A.index(1)



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

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

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

N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
assert isinstance(A, list)
a = A.index(1)
print((math.ceil((N - 1) / (K - 1))))

import math

N, K = list(map(int, input().split()))
print((math.ceil((N - 1) / (K - 1))))

-A = list(map(int, input().split())) -assert isinstance(A, list) -a = A.index(1)