N=int(input())
A=list(map(int,input().split()))
l=[0]*N
for i in range(N-1):
    if 0<A[i]-A[i+1]:l[i]=2
    elif A[i]-A[i+1]<0:l[i]=1
if A[-2]-A[-1]<0:l[-1]=2
m=1000
r=0
for i in range(N):
    if l[i]==1:
        r=m//A[i]
        m-=r*A[i]
    if l[i]==2:
        m+=r*A[i]
        r=0
print(m)