#!/usr/bin/env python
# -*- coding:utf-8 -*-
#要素の計算に注意！
N,K = map(int,input().split(" "))
A = list(map(int, input().split(" ")))

F=0
for i in A:
    if i==1:
        X=F 
        Y=N-(F+1)
        break;
    F=F+1

P=(X+Y)/(K-1)
if (X+Y)%(K-1)>0:
    print(P+1)
else:
    print(P)