n=int(input())
a=list(map(int,input().split()))

flag=0
b=[]
c=[]
for i in range(n-1):
    if a[i]<a[i+1]:
        if flag>0:
            pass
        else:
            flag=1
            b.append(a[i])
    else:
        if flag<=0:
            pass
        else:
            flag=-1
            c.append(a[i+1])
    #print(a[i])
    
if flag==1:
    c.append(a[n-1])
    
            
if c==[]:
    print(1000)
else:
    money=1000
    kabu=0
    for i in range(len(b)):
        kabu=money//b[i]
        money=money-kabu*b[i]+kabu*c[i]
        kabu=0
    print(money)
    
