fun main(args: Array<String>) {
    val N = readLine()!!.toInt()
    val A = Array(N) { readLine()!!.toLong() }

    var res = 0L
    var mx = 0L

    for (i in A.indices) {
        val t = (A[i] - 1) / (mx + 1)
        res += t
        val a = A[i] - (mx + 1) * t

        mx = Math.max(mx, if (t != 0L) 1L else A[i] - (mx + 1) * t)
        A[i] = a
    }

    println(res)
}
