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

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



if (n-1)%(k-1) != 0:

  cnt = (n-1)//(k-1)+1

else:

  cnt = (n-1)//(k-1)

  

print(cnt)
import math

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

print((math.ceil((n-k)/(k-1))+1))
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
if (n - 1) % (k - 1) != 0:
    cnt = (n - 1) // (k - 1) + 1
else:
    cnt = (n - 1) // (k - 1)
print(cnt)

import math

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

+import math + -a = list(map(int, input().split())) -if (n - 1) % (k - 1) != 0: -    cnt = (n - 1) // (k - 1) + 1 -else: -    cnt = (n - 1) // (k - 1) -print(cnt) +print((math.ceil((n - k) / (k - 1)) + 1))