Problem:
 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

Solution (Python):
import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 7)

N = int(input())
A = [int(input()) for _ in range(N)]

ans = A[0] - 1
p = 2

i = 1
while i < N:
    a = A[i]
    if a == p:
        p += 1
    else:
        ans += (a - 1) // p
    i += 1

print(ans)

Solution (Python):
N = int(input())
A = []
for i in range(N):
    A.append(int(input()))
count = 0
cur = 1
for i in range(N):
    if A[i] > cur:
        count += (A[i]-1)//cur
    elif A[i] == cur:
        cur += 1
    if cur == 1:
        cur += 1
print(count)

Solution (Python):
n=int(input())
a=[int(input()) for _ in range(n)]
def main(n,a):
  pre=0
  ans=0
  for x in a:
    if pre+2<=x:
      
      
      if x%(pre+1)==0:
        tmp=x//(pre+1)
        ans+=tmp-1
        pre=max(pre,1)
      else:
        tmp=x//(pre+1)
        ans+=tmp
        pre=max(pre,x%(pre+1))
    else:
      pre=max(pre,x)
  print(ans)
main(n,a)

Solution (Python):
n = int(input())
a = [int(input()) for _ in range(n)]
ans = a[0] - 1
max_before = 1
for i in range(1, n):
    if a[i] <= max_before:
        continue
    elif a[i] == max_before + 1:
        max_before += 1
    else:
        ans += (a[i] - 1) // (max_before + 1)
print(ans)

Solution (Python):
n = int(input())
A = [int(input()) for _ in range(n)]
ans = A[0] - 1
tmp = 1
for a in A[1:]:
    if a <= tmp:
        pass
    elif a - 1 == tmp:
        tmp = a
    else:
        ans += (a - 1) // (tmp + 1)
print(ans)

Solution (Python):
I,A=input,int
n=A(I())
a=[A(I())for i in range(n)]
L,C=a[0]-1,2
for i in a[1:]:
 if i==C:C+=1
 L+=(i-1)//C
print(L)

Solution (Python):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    N = int(readline())

    first = int(readline())

    ans = first - 1
    p_max = 1

    for _ in range(N - 1):
        cur = int(readline())
        if cur <= p_max:
            continue
        if cur == p_max + 1:
            p_max = cur
        else:
            ans += (cur - 1) // (p_max + 1)

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
p = int(input())
ans = p - 1
bottom = 1
for _ in range(N-1):
    p = int(input())
    if p == bottom + 1:
        bottom += 1
    elif p % (bottom+1) == 0:
        ans += p // (bottom+1) - 1
    else:
        ans += p // (bottom+1)
print(ans)

Solution (Python):
n=int(input())
A=[int(input()) for ii in range(n)]

ans=A[0]-1
now=2
for i in range(1,n):
    if A[i]==now:
        now+=1;continue
    ans+= (A[i]-1)//now
print(ans)

Solution (Python):
import sys
input = sys.stdin.readline

N = int(input())
A = [int(input()) for _ in range(N)]
cur = 1
ans = A[0] - 1
for a in A[1:]:
    if a == cur + 1:
        cur += 1
    elif a % (cur + 1) == 0:
        ans += a // (cur + 1) - 1
    else:
        ans += a // (cur + 1)
print(ans)

Solution (Python):
n=int(input())
l=[]
for i in range(n):
        a=int(input())
        l.append(a)

ans=l[0]-1
nowmin=2
for i in range(1,n):
        if l[i] == nowmin:
                nowmin+=1
                continue
        if l[i]%nowmin==0:
                l[i]-=(nowmin+1)
                ans+=1
        ans += l[i]//nowmin
print(ans)

Solution (Python):
n = int(input())
curr_max = 0
ans = 0
for i in range(n):
    a = int(input())
    if i == 0:
        ans += (a-1)
        curr_max = 1
    else:
        step = curr_max + 1
        if a > step: 
            diff = a - 1
            ans += diff//step
        else:
            curr_max = max(a, curr_max)
            

print(ans)

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N = int(input())
ans = 0
for i in range(N):
    a = int(input())
    if i==0:
        base = 2
        ans += a-1
        continue
    if a<base:
        continue
    if a==base:
        base+=1
    elif a%base==0:
        ans += (a-1)//base
    else:
        ans += a//base
print(ans)

Solution (Python):
n = int(input())
alst = [int(input()) for _ in range(n)]
ans = alst[0] - 1
price = 2
max_p = 2
for a in alst[1:]:
    if a > price:
        ans += (a - 1) // price
    elif max_p == a:
        max_p += 1
        price += 1
print(ans)

Solution (Python):
n=int(input())
a=[int(input()) for _ in range(n)]
mi=1
ans=a[0]-1
for x in a[1:]:
  if x>mi+1:
    ans+=(x-1)//(mi+1)
  else:
    mi=max(mi,x)
print(ans)

Solution (Python):
N=int(input())
A=[int(input()) for i in range(N)]
P=0
X=1
for i in range(N):
  P+=(A[i]-1)//X
  if A[i]==X or X==1:
    X+=1
print(P)

Solution (Python):
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)

Solution (Python):
N = int(input())
A = []
for _ in range(N):
  A.append(int(input()))
  
cnt = A[0] - 1
cant_use = 1
for a in A[1:]:
  wk = a
  if wk == cant_use+1:
    
    cant_use += 1
    continue
    
  if wk % (cant_use+1) == 0:
    wk -= cant_use + 2
    cnt += 1
  cnt += wk // (cant_use+1)
print(cnt)

Solution (Python):
import sys
sys.setrecursionlimit(10**7) 
import math
from copy import copy, deepcopy
from copy import deepcopy as dcp
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right

from collections import deque


from collections import Counter

from itertools import accumulate,combinations,permutations

from heapq import heapify,heappop,heappush


from functools import lru_cache

from decimal import Decimal

def input(): 
    x=sys.stdin.readline()
    return x[:-1] if x[-1]=="\n" else x
def printl(li): _=print(*li, sep="\n") if li else None
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds
def alp2num(c,cap=False): return ord(c)-97 if not cap else ord(c)-65
def num2alp(i,cap=False): return chr(i+97) if not cap else chr(i+65)
def matmat(A,B):
    K,N,M=len(B),len(A),len(B[0])
    return [[sum([(A[i][k]*B[k][j]) for k in range(K)]) for j in range(M)] for i in range(N)]
def matvec(M,v):
    N,size=len(v),len(M)
    return [sum([M[i][j]*v[j] for j in range(N)]) for i in range(size)]
def T(M):
    n,m=len(M),len(M[0])
    return [[M[j][i] for j in range(n)] for i in range(m)]
def main():
    mod = 1000000007
    

    N = int(input())
    
    
    A = tuple(int(input()) for i in range(N)) 
    
    cur=1
    ans=0
    for i,a in enumerate(A):
        if i==0:
            ans+=a-1
            cur=2
            continue
        if a==cur:
            cur+=1
            continue
        d,x=divmod(a,cur)
        if x==0:
            a-=cur+1

            ans+=a//cur+1
        else:
            ans+=d

    print(ans)


        
        




if __name__ == "__main__":
    main()

Solution (Python):
import sys
sys.setrecursionlimit(10**7)

readline = sys.stdin.buffer.readline
def readstr():return readline().rstrip().decode()
def readstrs():return list(readline().decode().split())
def readint():return int(readline())
def readints():return list(map(int,readline().split()))
def printrows(x):print('\n'.join(map(str,x)))
def printline(x):print(' '.join(map(str,x)))

n = readint()
a = [readint() for i in range(n)]

ans = a[0]-1
p = 2

for i in range(1,n):
    if a[i]%p==0:
        ans += a[i]//p-1
        if a[i] == p:
            p+=1
    else:
        ans += a[i]//p

print(ans)

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 8)
ini = lambda: int(sys.stdin.readline())
inm = lambda: map(int, sys.stdin.readline().split())
inl = lambda: list(inm())
ins = lambda: sys.stdin.readline().rstrip()


N = ini()
A = [ini() for _ in range(N)]


def solve():
    p_min = 1
    ans = 0
    
    for i in range(N):
        if A[i] < p_min:
            continue
        if A[i] == p_min:
            p_min += 1
            continue
        k = (A[i] - 1) // p_min
        ans += k
        A[i] = 1
        if p_min == 1:
            p_min += 1
        
    return ans


print(solve())

Solution (Python):
N = int(input())

min_P = 1
ans = 0
for _ in range(N):
    A = int(input())
    if A == min_P:
        min_P += 1
    else:
        ans += (A - 1) // min_P
        if min_P == 1:
            min_P += 1

print(ans)

Solution (Python):
n=int(input())
f=1
ans=0
for _ in range(n):
  a=int(input())
  m=(a-1)//f
  ans+=m
  a-=m*f
  if m:a=1
  f=max(f,a+1)
print(ans)

Solution (Python):
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)

Solution (Python):
n = int(input())
a = [int(input()) for _ in range(n)]

ans = 0
tmp = 1
for i in range(n):
    if a[i] > tmp:
        ans += (a[i] - 1) // tmp
        a[i] = 1

    tmp = max(tmp, a[i] + 1)

print(ans)

Solution (Python):
import sys
input = sys.stdin.readline
n = int(input())
A = [int(input()) for i in range(n)]

t = 1
ans = 0
for i in range(n):
    if A[i] == t:
        t += 1
    elif A[i] % t == 0:
        ans += (A[i]-1) // t
    else:
        ans += A[i] // t
    if t == 1:
        t += 1
    
print(ans)

Solution (Python):
def N(): return int(input())
def NM():return map(int,input().split())
def L():return list(NM())
def LN(n):return [N() for i in range(n)]
def LL(n):return [L() for i in range(n)]
n=N()
l=LN(n)
ans=l[0]-1
lo=2
for i in l[1:]:
    if i==lo:
        lo+=1
    else:
        ans+=(i-1)//lo
print(ans)

Solution (Python):

N=int(input())
ans=0
d=[int(input()) for _ in range(N)]
if d[0]>1:
    ans+=d[0]-1
d[0]=1
now=2
for i in range(1,N):
    if d[i]==now:
        now+=1
    else:
        
        if d[i]<now:
            pass
        elif d[i]>now:
            if d[i]%now==0:
                K=d[i]//now
                if K==2:
                    ans+=1
                    d[i]=1
                elif K>2:
                    ans+=K-1
                    d[i]=1                
            elif d[i]%now!=0:
                u,v=divmod(d[i],now)
                ans+=u
                d[i]=v
print(ans)

Solution (Python):
import sys
input = sys.stdin.readline

N = int(input())
A = [int(input()) for _ in range(N)]
ans = A[0] - 1
P = 2
for i in range(1, N):
    if A[i] == P:
        P += 1
        continue
    ans += (A[i]-  1) // P
print(ans)

Solution (Python):
n=int(input())
a=[]
for i in range(n):
  a.append(int(input()))
cur = 1
ans = 0
for i in a:
  num = (i - 1) // cur
  ans += num
  i -= cur * num
  if cur != i or i == 1 or num == 0:
  	cur = max(cur,i+1)
  
print(ans)

Solution (Python):
import sys
input = sys.stdin.buffer.readline

def main():
	N = int(input())
	
	ans = 0
	a1 = int(input())
	ans += a1-1

	base = 2
	for _ in range(N-1):
		a = int(input())
		if a < base:
			continue
		elif a == base:
			base += 1
		else:
			ans += (a-base-1)//base+1
	
	print(ans)

if __name__ == "__main__":
	main()

Solution (Python):
n = int(input())
m = 1
ans = int(input()) - 1
for _  in range(n-1):
  a = int(input())
  if a == m+1:
    m += 1
  else:
    ans += (a-1)//(m+1)
print(ans)

Solution (Python):
import sys

input=sys.stdin.readline

N=int(input())
ans=0
val=2
for i in range(N):
    a=int(input())
    if i==0:
        ans+=a-1
        val=2
    else:
        if a!=val:
            ans+=(a-1)//val
        else:
            val+=1

print(ans)

Solution (Python):
N=int(input())
ans=0
val=2
for i in range(N):
    a=int(input())
    if i==0:
        ans+=a-1
        val=2
    else:
        if a!=val:
            ans+=(a-1)//val
        else:
            val+=1

print(ans)

Solution (Python):
n = int(input())
a = int(input())
ans = 0
ans += a-1
minim = 2
for ii in range(n-1):
    a = int(input())
    i = ii+1
    if(a==minim):
        minim+=1
    else:
        ans+=(a-1)//minim

print(ans)

Solution (Python):
n = int(input())
a = int(input())
ans = 0
ans += a-1
minim = 2
for ii in range(n-1):
    a = int(input())
    i = ii+1
    if(a==minim):
        minim+=1
    else:
        ans+=(a-1)//minim

print(ans)

Solution (Python):
n = int(input())
M = 0
ans = 0
for i in range(n):
    a = int(input())
    if M == 0:
        ans += a-1
        M = 1
    elif a <= M+1:
        M = max(M,a)
    else:
        ans += (a-1)//(M+1)
print(ans)

Solution (Python):
N = int(input())
a0 = int(input())

rem = 1
res = a0 - 1

for _ in range(N - 1):
    a = int(input())
    if a >= rem + 2:
        res += (a - 1) // (rem + 1)
    elif a == rem + 1:
        rem = a
    else:
        pass

print(res)

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.readline

N, *A = map(int, read().split())
if N == 1:
    print(A[0] - 1)
    exit()

answer = A[0] - 1
P = 2
for i in A[1:]:
    if i < P:
        continue
    elif i == P:
        P += 1
        continue
    answer += (i - 1) // P

print(answer)

Solution (Python):
N = int(input())
A = [int(input()) for i in range(N)]

ans = A[0] - 1
min_a = 1
for a in A[1:]:
  p = min_a + 1
  if a % p:
    ans += a // p
  else:
    diff = a//p - 1
    if diff:
      ans += diff
    else:
      min_a = a

print(ans)

Solution (Python):
import sys

n, *aaa = map(int, sys.stdin.buffer.read().split())

ans = aaa[0] - 1
min_p = 2
for a in aaa[1:]:
    if a == min_p:
        min_p += 1
        continue
    d, m = divmod(a, min_p)
    if m == 0:
        d -= 1
    ans += d
print(ans)

Solution (Python):


import sys
from itertools import accumulate

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

N = INT()
A = LIST(N)

lim = 1
ans = 0
for a in A:
    d, m = divmod(a, lim)
    if d == 0 or d == 1 and m == 0:
        lim = max(lim, a+1)
    else:
        ans += d - (m == 0)
        lim = max(lim, 2)
print(ans)

Solution (Python):
N,*A = map(int, open(0).read().split())
p = 1
ans = 0
for c in A:
  if c%p!=0:
    ans += c//p
  else:
    if c==p:
      p += 1
      continue
    ans += c//p-1
    if p==1:
      p += 1
print(ans)

Solution (Python):




from collections import *
from itertools import *
from bisect import *
from heapq import *
import copy
import math
from fractions import gcd
import sys





N=int(input())
A=[int(input()) for i in range(N)]
count=A[0]-1
m=1
for i in range(1,N):
    z=(A[i]-1)//(m+1)
    count+=z
    if not z:
        m=max(m,A[i])
    
print(count)

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

ans = A[0]-1
tmp = 2
for i in range(1, N):
    if A[i] == tmp:
        tmp += 1
    elif A[i] > tmp:
        ans += (A[i]-1)//tmp

print(ans)

Solution (Python):
printn = lambda x: print(x,end='')
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True 
BIG = 10**18
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

n = inn()
a = []
for i in range(n):
    a.append(inn())
sm = a[0]-1
px = 1

for i in range(1,n):
    
    
    
    inc = (a[i]-px)//(px+1) + (1 if (a[i]-px)%(px+1)>=2 else 0)
    sm += inc
    if a[i]==px+1:
        px += 1
    
print(sm)

Solution (Python):
import sys
input = sys.stdin.readline

N = int(input())
As = [int(input()) for _ in range(N)]

ans = As[0]-1
M = 1
for A in As[1:]:
    if A == M+1:
        M += 1
    else:
        if A > M+1:
            ans += (A-(M+2))//(M+1) + 1

print(ans)

Solution (Python):
N = int(input())
A = [ int(input()) for _ in range(N) ]

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

Solution (Python):
def main():
	n, *a = map(int, open(0).read().split())
	cur = 1
	ans = a[0] - 1
	a[0] = 1
	for x in a:
		if x <= cur:
			pass
		elif x == cur + 1:
			cur = x
		else:
			ans += 0 - -(x - cur - 1) // (cur + 1)
	print(ans)

if __name__=="__main__":
	main()

Solution (Python):
n,*a=map(int,open(0).read().split())
cur=1
ans=a[0]-1
a[0]=1
for x in a:
	if x<=cur:
		pass
	elif x==cur+1:
		cur=x
	else:
		ans+=0--(x-cur-1)//(cur+1)
print(ans)

Solution (Python):
N, *A = map(int, open(0))

ans = A[0] - 1
cur = 2
for a in A[1:]:
    if a == cur:
        cur += 1
    else:
        ans += (a - 1) // cur

print(ans)

Solution (Python):

n = int(input())
for i in range(n):
  a = int(input())
  if i == 0:
    ans = a - 1
    now = 2
    continue
  if a == now:
    now += 1
    
    continue
  ans += (a-1) // now
  
print(ans)

Solution (Python):
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-1) // cur_limit

print(answer)

Solution (Python):
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)

Solution (Python):
N = int(input())
ans = 0
now = 1
for _ in range(N):
    A = int(input())
    ans+=(A-1)//now
    r = (A-1)%now+1
    if r+1>now:
        if now == 1 or (A-1)//now == 0:
            now = r+1
        
print(ans)

Solution (Python):
n = int(input())
a = list(map(int,  [input() for i in range(n)]))
ans = 0
for i in range(n):
	if i == 0:
		ans += a[i] - 1
		a[i] = 1
	else:
		if a[i - 1] + 1< a[i]:
			ans += (a[i] - 1) // (a[i - 1] + 1)
			a[i] = a[i - 1]
		else:
			a[i] = max(a[i - 1], a[i])
print(ans)

Solution (Python):
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)

Solution (Python):
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)

Solution (Python):
def main():
    N = int(input())
    A = [int(input()) for i in range(N)]
    mi = 1
    ans = A[0] - 1 if A[0] != 1 else 0
    for a in A[1:]:
        if a <= mi + 1:
            mi = max(mi, a)
            continue
        ans += (a - 1) // (mi + 1)
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
def main():
    N = int(input())
    A = [int(input()) for i in range(N)]
    mi = 0
    ans = 0
    for a in A:
        if a <= mi+1:
            mi = max(mi, a)
            continue
        ans += (a-1)//(mi+1)
        mi = max(mi, 1)
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
A = [int(input()) for i in range(N)]

ans = A[0]-1
v = 2
for a in A[1:]:
    if a < v: continue
    if a == v:
        v += 1
        continue
    ans += (a-1)//v
print(ans)

Solution (Python):











import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,sqrt,factorial,hypot,log 
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint
def ceil(a,b): return (a+b-1)//b
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')

def main():
    N=I()
    A=LIN(N)
    now = 1
    ans = A[0]-1
    for a in A[1:]:
        if a <= now + 1:
            now = max(a,now)
            continue
        ans += (a-1)//(now+1)
    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
import sys
from collections import defaultdict as dd
input = sys.stdin.readline
N = int(input())
a = []
for _ in range(N): a.append(int(input()))
res = a[0] - 1
a[0] = 1
mx = 1
mxa = max(a)
for i in range(N - 1):
  mx = max(mx, a[i])
  t = (a[i + 1] - 1) // (mx + 1)
  ok = mx + 1
  ng = mxa
  while ng - ok > 1:
    m = (ok + ng) // 2
    if (a[i + 1] - 1) // m == t: ok = m
    else: ng = m
  if t > 0: a[i + 1] = 1
  res += t
  
  
print(res)

Solution (Python):
import sys
input = sys.stdin.readline
N = int(input())
mx = 1
a = []
for _ in range(N): a.append(int(input()))
res = a[0] - 1
a[0] = 1
for i in range(1, N):
  ok = mx + 1
  ng = a[i]
  ch = (a[i] - 1) // (mx + 1)
  while ng - ok > 1:
    m = (ok + ng) // 2
    if (a[i] - 1) // m == ch:
      ok = m
    else: ng = m
  res += (a[i] - 1) // ok
  if (a[i] - 1) // ok: a[i] = 1
  mx = max(mx, a[i])
  
print(res)

Solution (Python):
N = int(input())
A = list(int(input())for _ in range(N))

P = 1
ans = A[0]-1
A[0] = 1
for i in range(N):
    ans += (A[i]-1)//P
    if A[i] == P:
        P += 1

print(ans)

Solution (Python):
n = int(input())
a = [int(input()) for _ in range(n)]
cnt = a[0] - 1
a[0] = 1
t = 1
for x in a:
  if x == t: t += 1
  if x < t: continue
  if x%t == 0:
    x -= t+1
    cnt += 1
  cnt += x//t
print(cnt)

Solution (Python):
"""
Greedyなのか？
よさそう→所持金として存在しない最小の整数を選んでく？
dicで管理かなぁ→X

シミュレーションは無理！
いくつ引けるか考える→一度処理したらもう使わない
よってO(N)!!

1 2 6 7 7 7 7 7 7 7
の時、3番目で3を使ってしまうのはもったいない！！
→最大化するためには大きい数字で小さい数字を使いたい

同じ数字が来た！→仕方ないので引き上げ
そうでない→ +1した数字を使ってずらす(そこの部分の答えは変わらない)

now の2倍+1以上→now以下にできる(1は除く) ansはA[i] // now

"""

N = int(input())

A = []

for i in range(N):

    a = int(input())
    A.append(a)

ans = 0
now = 1

for i in range(N):

    if now == 1:
        ans += A[i]-1
        now += 1

    elif now == A[i]:
        now += 1

    elif A[i] % now == 0:
        ans += A[i] // now - 1
    else:
        ans += A[i] // now

print (ans)

Solution (Python):
def examA():
    S = SI(); N = len(S)
    T = "CODEFESTIVAL2016"
    ans = 0
    for i in range(N):
        if S[i]!=T[i]:
            ans +=1
    print(ans)
    return

def examB():
    N, A, B = LI()
    S = SI()
    d = defaultdict(int)
    for s in S:
        if s=="a":
            if d["a"]+d["b"]<A+B:
                print("Yes")
                d[s] += 1
            else:
                print("No")
        elif s=="b":
            if d["a"]+d["b"]<A+B and d["b"]<B:
                print("Yes")
                d[s] += 1
            else:
                print("No")
        else:
            print("No")
    return

def examC():
    W, H = LI()
    P = [I() for _ in range(W)]; P.sort()
    Q = [I() for _ in range(H)]; Q.sort()
    dh = 0; dw = 0
    p = 0; q = 0
    ans = 0
    for i in range(H+W):
        if (q<H and p<W and P[p]<Q[q]) or not q<H:
            ans += P[p]*(H+1-dh)
            p +=1; dw +=1
        else:
            ans += Q[q]*(W+1-dw)
            q +=1; dh+=1
    print(ans)
    return

def examD():
    N = I()
    A = [I() for _ in range(N)]
    flag = 1
    ans = A[0]-1
    A[0] = 1
    for i in range(1,N):
        a = A[i]
        if a==flag+1:
            flag +=1
        ans += (a-1)//(1+flag)
    print(ans)
    return

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,ALPHABET, _ep
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = 1e-9
alphabet = [chr(ord('a') + i) for i in range(26)]
ALPHABET = [chr(ord('A') + i) for i in range(26)]

if __name__ == '__main__':
    examD()

Solution (Python):

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()

Solution (Python):
n = int(input())
a = []
for i in range(n):
    a0 = int(input())
    a.append(a0)
ans = 0
key = "b"
count = 1
m = 0
for i in range(n):
    if key == "a":
        if a[i] == count:
            count += 1
        elif a[i] > count:
            if a[i]%count == 0:
                ans += a[i]//count - 1
            else:
                ans += a[i]//count
    else:
        if i == 0:
            ans += a[i]-1
            count += 1
        else:
            if a[i] == 2:
                key = "a"
                count = 3
                m = 2
            else:
                if a[i]%2 == 0:
                    ans += a[i]//2-1
                else:
                    ans += a[i]//2
    
print(ans)

Solution (Python):

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


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



if __name__ == '__main__':
    solve()

Solution (Python):
N = int(input())
A = [int(input()) for _ in range(N)]

count = A[0] - 1
tmp = 2

for a in A[1:]:
    count += (a - 1) // tmp
    if tmp == a:
        tmp += 1

print (count)

Solution (Python):


def main():
    import sys
    input = sys.stdin.readline

    N = int(input())
    A = [int(input()) for _ in range(N)]

    ret = A[0] - 1
    div = 2
    for x in A[1:]:
        if x == div:
            div += 1
            continue
        ret += (x - 1) // div
    print(ret)


if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
A = [int(input()) for _ in range(N)]
cnt = 0
if A[0]>1:
    cnt += A[0]-1
    A[0]=1
cur = 1
for i in range(1,N):
    if A[i]<=cur:continue
    if A[i]==cur+1:
        cur += 1
        continue
    a = A[i]
    n = (a-cur-2)//(cur+1)
    cnt += (n+1)
print(cnt)

Solution (Python):
n = int(input())
a = [int(input()) for _ in range(n)]
ans = 0
cur = 1
for x in a:
	if x == cur:
		cur += 1
	else:
		ans += (x-1)//cur
		if cur == 1:
			cur += 1
print(ans)

Solution (Python):
n = int(input())
a = [int(input()) for _ in range(n)]
ans = 0
cur = 1
for x in a:
	if x == cur:
		cur += 1
	else:
		ans += (x-1)//cur
		if cur == 1:
			cur += 1
print(ans)