program MSOLUTIOND
    implicit none
    integer(8)::N,i,ans=1000
    integer(8),allocatable,dimension(:)::A
    read*,N
    allocate(A(N))
    read*,A

    do i=1,N-1
        if(A(i+1)>A(i))then
            ans=ans/A(i)*A(i+1)+mod(ans,A(i))
        end if
    end do
    print'(i0)',ans
end program MSOLUTIOND