program main
    use,intrinsic :: iso_fortran_env
    implicit none
    integer(int64):: n,i,ans=1000
    integer(int64), allocatable:: a(:)

    read*, n
    allocate(a(n))
    read*, a(:)

    do i=1,n-1
        if (a(i+1) > a(i)) then
            ans = ans + (ans/a(i))*(a(i+1)-a(i))
        end if
    end do
    print'(i0)', ans
end program main