n=int(input())
m=list(map(int,input().split()))
a=[]
if m[0]<m[1]:
    a.append([0,-1])
for i in range(1,n-1):
    if m[i]>m[i-1] and m[i]>=m[i+1]:
        a.append([i,1])
    elif m[i]<=m[i-1] and m[i]<m[i+1]:
        a.append([i,-1])
    elif m[i]<m[i-1] and m[i]<=m[i+1]:
        a.append([i,-1])
    elif m[i]<=m[i-1] and m[i]<m[i+1]:
        a.append([i,1])
if m[n-1]>m[n-2]:
    a.append([n-1,1])
#print(a)
k=0
r=1000
t=0
for i in range(len(a)):
    if a[i][1]==-1 and t==0:
        k=r//m[a[i][0]]
        r-=k*m[a[i][0]]
        t=1
    elif a[i][1]==1 and t==1:
        
        
        r+=k*m[a[i][0]]
        k=0
        t=0
        
    #print(k,r)
print(r)
        
        