N=int(input())
*A,=map(int,input().split())
M=max(A)

now=1000
amari=0
stock=0
i=0
while i<N-1:
    if A[i]<A[i+1]:
        if stock<now//A[i]:
            stock=now//A[i]
            amari=now%A[i]
    elif A[i]>A[i+1]:
        now=max(A[i]*stock+amari,now)
    i+=1

now=max(amari+stock*A[i],now)
print(now)