import math

def process_smaller_index(K, min_index):
    if min_index == 0:
        return 0
    else:
        return math.ceil(min_index / K)

def process_larger_index(last_index, K, min_index):
    if min_index == last_index:
        return 0
    else:
        return math.ceil((last_index - min_index) / K)

N, K = map(int, input().split())
A = [int(i) for i in input().split()]
min_index = A.index(1)
print(process_smaller_index(K - 1, min_index) + process_larger_index(len(A)-1, K - 1, min_index))