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

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



def f():

  for i in range(1, N+1):

    if (K-1)*i + 1 >= N:

      return i

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



def f():

  for i in range(1, N+1):

    if (K-1)*i + 1 >= N:

      return i

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


def f():
    for i in range(1, N + 1):
        if (K - 1) * i + 1 >= N:
            return i


print((f()))

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


def f():
    for i in range(1, N + 1):
        if (K - 1) * i + 1 >= N:
            return i


print((f()))

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