n,k = map(int, input().split())
a = list(map(int, input().split()))
 
ind = a.index(1)
 
left = ind
right = n-1-ind
import math
if left<k-1 or right<k-1:
	print (n//(k-1))
else:
	if k>=n:
		print (1)
	else:
		print(int(math.ceil(left/(k-1))+math.ceil(right/(k-1))))
