N,K=[int(s) for s in input().split()]

x=1

for i in range(1,N):

  x+=(K-1)

  if x>=N:

    print(i)

    break

  

  
N,K=[int(s) for s in input().split()]

print(((N+K-3)//(K-1)))
N, K = [int(s) for s in input().split()]
x = 1
for i in range(1, N):
    x += K - 1
    if x >= N:
        print(i)
        break

N, K = [int(s) for s in input().split()]
print(((N + K - 3) // (K - 1)))

-x = 1 -for i in range(1, N): -    x += K - 1 -    if x >= N: -        print(i) -        break +print(((N + K - 3) // (K - 1)))