import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = println(solve(new Scanner(System.in)))

  def solve(in: String): String = solve(new Scanner(in))

  def solve(sc: Scanner): String = {
    val N = sc.nextInt
    val K = sc.nextInt
    val A = Array.fill(N)(sc.nextInt)

    var ans = 0
    var n = N
    while (n > K) {
      ans += (n / K)
      n = (n / K) + (n % K)
    }
    if (n > 1) ans += 1
    ans.toString
  }
}
