program greedy_customers
  implicit none
  integer :: n, a(100000), x, i
  integer(8) :: m
  a = 0
  read(*,*) n
  do i = 1, n
    read(*,*) a(i)
  end do
  x = 1
  m = int(a(1)-1,8)
  do i = 2, n
    if (a(i).le.x+1) then
      x = max(x,a(i))
    else
      m = m+int((a(i)-1)/(x+1),8)
    end if
  end do
  write(*,'(i0)') m
  stop
end program greedy_customers