program main
  implicit none
  integer::n,x,a,res
  read*,n
  read*,a
  res=a-1
  if(res.eq.1)then
     do while (n.gt.0)
        n=n-1
        read*,a
        if(a.ne.2)exit
        res=res+1
        !print*,a                                                                                                                     
     end do

  endif

  x=2
  do while (n.gt.1)
     n=n-1
     read*,a
     if(a.eq.x)x=x+1
     res=res+(a-1)/x
  end do
  print*,res
end program main
