fun main(args: Array<String>){
    val (N, K) = readLine()!!.split(' ').map(String::toInt)
    val A: Array<Int> = readLine()!!.split(' ').map(String::toInt).toTypedArray()
    var size = A.size
    var counter = 0

    while (size > 0){
        size -= K - 1
        if (counter == 0){
            size -= 1
        }
        counter ++
        if (size <= 0) println(counter)
    }
}