fun main(args : Array<String>) {
    val (N, K) = readLine()!!.split(" ").map { it.toLong() }

    var count = 0L
    // Fix b
    (1..N).forEach { b ->
        val p = (N / b)
        val numberOfACandidates = (b - K) * p
        val remainders = N % b
            count += listOf(0, numberOfACandidates).max()!! + listOf(0, remainders - K + 1).max()!!
        if (K == 0L) {
            count--
        }
    }

    println(count)
}