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

N -= K

ans = 1

while N > 0:

  N -= K - 1

  ans += 1

print(ans)
import math



n, k = list(map(int, input().split()))

print((math.ceil((n - 1) / (k - 1))))
N, K = list(map(int, input().split()))
N -= K
ans = 1
while N > 0:
    N -= K - 1
    ans += 1
print(ans)

import math

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

-N, K = list(map(int, input().split())) -N -= K -ans = 1 -while N > 0: -    N -= K - 1 -    ans += 1 -print(ans) +import math + +n, k = list(map(int, input().split())) +print((math.ceil((n - 1) / (k - 1))))