import math

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

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



tmp = a.index(min(a))

amri = ((tmp) % (K - 1))

if amri == 0:

    ans = math.ceil(tmp / (K - 1)) + math.ceil((N - tmp - 1) / (K - 1))

else:

    ans = math.floor(tmp / (K - 1)) + math.ceil((N - tmp - (K- amri)) / (K - 1)) + 1

print(ans)
import math

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

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

ans = math.ceil((N - 1)/ (K - 1))

print(ans)
import math

N, K = list(map(int, input().split()))
a = list(map(int, input().split()))
tmp = a.index(min(a))
amri = (tmp) % (K - 1)
if amri == 0:
    ans = math.ceil(tmp / (K - 1)) + math.ceil((N - tmp - 1) / (K - 1))
else:
    ans = math.floor(tmp / (K - 1)) + math.ceil((N - tmp - (K - amri)) / (K - 1)) + 1
print(ans)

import math

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

-tmp = a.index(min(a)) -amri = (tmp) % (K - 1) -if amri == 0: -    ans = math.ceil(tmp / (K - 1)) + math.ceil((N - tmp - 1) / (K - 1)) -else: -    ans = math.floor(tmp / (K - 1)) + math.ceil((N - tmp - (K - amri)) / (K - 1)) + 1 +ans = math.ceil((N - 1) / (K - 1))