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

As = [int(c) for c in input().split()]

t = 1 if (N - 1) % (K - 1) else 0

print(((N - 1) // (K - 1) + t))
(lambda N, K, t: print((N - 1) // (K - 1) + t))(*((lambda N, K: [N, K, 1 if (N - 1) % (K - 1) else 0])(*[int(c) for c in input().split()])))

N, K = [int(c) for c in input().split()]
As = [int(c) for c in input().split()]
t = 1 if (N - 1) % (K - 1) else 0
print(((N - 1) // (K - 1) + t))

(lambda N, K, t: print((N - 1) // (K - 1) + t))(
    *(
        (lambda N, K: [N, K, 1 if (N - 1) % (K - 1) else 0])(
            *[int(c) for c in input().split()]
        )
    )
)

-N, K = [int(c) for c in input().split()] -As = [int(c) for c in input().split()] -t = 1 if (N - 1) % (K - 1) else 0 -print(((N - 1) // (K - 1) + t)) +(lambda N, K, t: print((N - 1) // (K - 1) + t))( +    *( +        (lambda N, K: [N, K, 1 if (N - 1) % (K - 1) else 0])( +            *[int(c) for c in input().split()] +        ) +    ) +)