Score: 700 points
Problem Statement
N people are waiting in a single line in front of the Takahashi Store. The cash on hand of the i-th person from the front of the line is a positive integer A_i. Mr. Takahashi, the shop owner, has decided on the following scheme: He picks a product, sets a positive integer P indicating its price, and shows this product to customers in order, starting from the front of the line. This step is repeated as described below. At each step, when a product is shown to a customer, if price P is equal to or less than the cash held by that customer at the time, the customer buys the product and Mr. Takahashi ends the current step. That is, the cash held by the first customer in line with cash equal to or greater than P decreases by P, and the next step begins. Mr. Takahashi can set the value of positive integer P independently at each step. He would like to sell as many products as possible. However, if a customer were to end up with 0 cash on hand after a purchase, that person would not have the fare to go home. Customers not being able to go home would be a problem for Mr. Takahashi, so he does not want anyone to end up with 0 cash. Help out Mr. Takahashi by writing a program that determines the maximum number of products he can sell, when the initial cash in possession of each customer is given.
Constraints
1 ≦ N ≦ 100000
1 ≦ A_i ≦ 10^9 (1 ≦ i ≦ N)
All inputs are integers.
Input
Inputs are provided from Standard Inputs in the following form.
N
A_1
:
A_N
Output
Output an integer representing the maximum number of products Mr. Takahashi can sell.
Sample Input 1
3
3
2
5
Sample Output 1
3
As values of P, select in order 1, 4, 1.
Sample Input 2
15
3
1
4
1
5
9
2
6
5
3
5
8
9
7
9
Sample Output 2
18

# Buggy version:
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")

n = int(input())
a = [None]*n
for i in range(n):
    a[i] = int(input())
ans = a[0]-1
prev = 1
for i,num in enumerate(a[1:]):
    if prev+1<num:
        while num-(prev+1)>0:
            v = (num-1)//(prev+1)
            num -= v*(prev+1)
            ans += 1
            if num==prev+1:
                num = prev
                break
    prev = max(prev, num)
print(ans)

# Fixed version:
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n = int(input())
a = [None]*n
for i in range(n):
    a[i] = int(input())
ans = a[0]-1
prev = 1
for i,num in enumerate(a[1:]):
    if prev+1<num:
        while num-(prev+1)>0:
            v = (num-1)//(prev+1)
            num -= v*(prev+1)
            ans += v
            if num==prev+1:
                num = prev
                break
    prev = max(prev, num)
print(ans)

# Buggy version:
N = int(input())
*A, = [int(input()) for _ in range(N)]

ans = 0
v = 0

for i, j in enumerate(A):
    if j==v+1:
        v += 1
    ans += (j-1)//(v+1)

print(ans)


# Fixed version:
N = int(input())
*A, = [int(input()) for _ in range(N)]

ans = 0
v = 1

for i, j in enumerate(A):
    if i==0:
        ans += j-1
    else:
        if j==v+1:
            v += 1
        ans += (j-1)//(v+1)

print(ans)

# Buggy version:
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
A = [ir() for _ in range(N)]
answer = A[0] - 1
cur_limit = 2
for a in A[1:]:
    if a == cur_limit:
        cur_limit += 1
        continue
    answer += (a-cur_limit) // cur_limit)

print(answer)
# 44


# Fixed version:
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
A = [ir() for _ in range(N)]
answer = A[0] - 1
cur_limit = 2
for a in A[1:]:
    if a == cur_limit:
        cur_limit += 1
        continue
    answer += -((-(a-cur_limit)) // cur_limit)

print(answer)
# 44

# Buggy version:
N = int(input())
A = [int(input()) for i in range(N)]
now = 2
count = A[0]-1
maxrem = 1
for i in range(1,N):
    if A[i] == now:
        now += 1
    elif A[i]%now:
        count += A[i]//(now+1)
    else:
        count += A[i]//now
print(count)

# Fixed version:
N = int(input())
A = [int(input()) for i in range(N)]
now = 2
count = A[0]-1
for i in range(1,N):
    if A[i] == now:
        now += 1
    elif A[i]%now != 0:
        count += A[i]//now
    else:
        count += (A[i]-1)//now
print(count)

# Buggy version:
import sys
input = sys.stdin.readline
n = int(input())
a = [int(input()) for i in range(n)]
cnt = 1
ans = 0
for i in range(n):
  if a[i] = cnt+1:
    cnt += 1
  else:
    ans += (a[i]-1)//cnt
    if cnt == 1:
      cnt += 1
print(ans)

# Fixed version:
import sys
input = sys.stdin.readline
n = int(input())
a = [int(input()) for i in range(n)]
cnt = 2
ans = a[0]-1
for i in range(1,n):
  if a[i] == cnt:
    cnt += 1
  else:
    ans += (a[i]-1)//cnt
print(ans)

# Buggy version:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline
INF = 2**62-1

def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, A):

    ans = 0
    b = 0
    for a in A:
        p = b + 1
        c = (a-1) // p
        ans += c
        if c == 0:
            b = a
        if b == 0:
            b = 1
        print(a, b, c, ans)

    return ans


def main():
    N = read_int()
    A = [read_int() for _ in range(N)]
    print(slv(N, A))


if __name__ == '__main__':
    main()


# Fixed version:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline
INF = 2**62-1


def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, A):
    a = A.pop(0)
    ans = a-1
    b = 2
    for a in A:
        if b == a:
            b += 1
        c = (a-1) // b
        ans += c
    return ans


def main():
    N = read_int()
    A = [read_int() for _ in range(N)]
    print(slv(N, A))


if __name__ == '__main__':
    main()

# Buggy version:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = 1e10

#solve
def solve():
    ans = 0
    pre = 1
    for _ in range(II()):
        a = II()
        if pre > a:
            continue
        if a % pre:
            ans += a // pre
            continue
        if pre == a:
            pre += 1
            continue
        tmp = a // pre - 1
        ans += tmp
    print(ans)

    return


#main
if __name__ == '__main__':
    solve()


# Fixed version:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = 1e10

#solve
def solve():
    ans = 0
    pre = 1
    for _ in range(II()):
        a = II()
        if pre > a:
            continue
        if a % pre:
            ans += a // pre
            continue
        if pre == a:
            pre += 1
            continue
        tmp = a // pre - 1
        ans += tmp
        if pre == 1:
            pre += 1
    print(ans)

    return


#main
if __name__ == '__main__':
    solve()

# Buggy version:
N = int(input())
A = [0] * N
Z = 0
cnt = 0
for i in range(N):
  a = int(input())
  if a > Z + 1:
    z = (a - 1) // (Z + 1)
    cnt += z
  else:
    Z = max(a, Z)
print(cnt)

# Fixed version:
N = int(input())
A = [0] * N
Z = 0
cnt = 0
for i in range(N):
  a = int(input())
  if a > Z + 1:
    z = (a - 1) // (Z + 1)
    cnt += z
    a = 1
  Z = max(a, Z)
print(cnt)

# Buggy version:
n = int(input())
a = [int(input()) for i in range(n)]
a = a[::-1]

ans = 0
num = 1

while a:
    if a[-1] == num:
        num += 1
    elif a[-1] > num:
        if a[-1] % num == 0:
            a[-1] = a[-1] - (num + 1)
            ans += 1
            ans +=  a[-1] // num
        else:
            ans += a[-1] // num
    del a[-1]

print(ans)

# Fixed version:
n = int(input())
a = [int(input()) for i in range(n)]
a = a[::-1]

ans = 0
num = 1

while a:
    if a[-1] < num:
        del a[-1]
    elif a[-1] == num:
        num += 1
    elif a[-1] > num:
        if a[-1] % num == 0:
            ans += a[-1] // num - 1
            a[-1] = 1
        else:
            ans += a[-1] // num
            a[-1] = 1

print(ans)

# Buggy version:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

n = int(input())
arr = []
for i in range(n):
    arr.append(int(input()))
count = max(arr[0]-1,0)
index = 2
for a in arr:
    if a > index:
        count += (a - 1) // index
    if a == index:
        index += 1
print(count)

# Fixed version:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

n = int(input())
arr = []
for i in range(n):
    arr.append(int(input()))
count = max(arr[0]-1,0)
index = 2
for i in range(1,n):
    if arr[i] > index:
        count += (arr[i] - 1) // index
    if arr[i] == index:
        index += 1
print(count)

# Buggy version:
N=int(input())
a=[0]*N
for i in range(N):
    a.[i]=int(input())
minimum=1
count=0
for i in  a:
   if(minimum<i):
       if i%minimum:
           count+= i//minimum
       else :
           count+= (i//minimum-1)
   else:
       minimum=max(minimum,i+1)
print(count)


# Fixed version:
N=int(input())
a=[0]*N
for i in range(N):
    a[i]=int(input())

minimum=2
count=a[0]-1
a.pop(0)
for i in  a:
   if(minimum<i):
       if i%minimum:
           count+= i//minimum
       else :
           count+= (i//minimum-1)
   else:
       minimum=max(minimum,i+1)
print(count)

# Buggy version:
# def makelist(n, m):
# 	return [[0 for i in range(m)] for j in range(n)]

n = int(input())
A = [0]*N
for i in range(N):
	A[i] = int(input())

ans = A[0] - 1
A[0] = 1

cnt = 1
# yobi = 1

for i in range(1, N):
	now = A[i]

	if now > cnt:
		if now == cnt + 1: ## 0 ni nattyau
			cnt += 1
		else: ## now >= cnt + 2
			ans += now // (cnt + 1)
			if now % (cnt + 1) == 0:
				ans -= 1

print(ans)


# Fixed version:
# def makelist(n, m):
# 	return [[0 for i in range(m)] for j in range(n)]

N = int(input())
A = [0]*N
for i in range(N):
	A[i] = int(input())

ans = A[0] - 1
A[0] = 1

cnt = 1
# yobi = 1

for i in range(1, N):
	now = A[i]

	if now > cnt:
		if now == cnt + 1: ## 0 ni nattyau
			cnt += 1
		else: ## now >= cnt + 2
			ans += now // (cnt + 1)
			if now % (cnt + 1) == 0:
				ans -= 1

print(ans)

# Buggy version:
N = int(input())
A = [ int(input()) for _ in range(N) ]

ans =  0
m = 0
for a in A:
  if a == m+1:
    m = m + 1
  else:
    ans += (a - 1) // (m+1)
print(ans)


# Fixed version:
N = int(input())
A = [int(input()) for _ in range(N)]
ans = A[0] - 1
m = 1
for a in A[1:]:
    if a == m + 1:
        m += 1
    else:       
        ans += (a-1) // (m + 1)
print(ans)