N=int(input())
A=list(map(int,input().split()))
A.append(0)
money=1000
buy=0
flag=0
for i in range(N):
    if A[i]<A[i+1]:
        buy=A[i]
        flag=1
    elif A[i]>A[i+1] and flag==1:
        b=money//buy
        money=money%buy+A[i]*b
        flag=0
print(money)