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

ans=1000
kabu=0
flag=0

for i in range(n-1):
    if a[i]<a[i+1]:
        if flag !=1:
            kabu=int(ans/a[i])
            ans-=(kabu*a[i])
            #print(a[i],ans,kabu)
        flag=1
    elif a[i]>a[i+1]:
        if flag >0:
            ans+=(kabu*a[i])
            #print(ans)
        flag=-1
    else:
        if flag>0:
            flag=2
        else:
            flag=-2
    if i==(n-2) and flag>0:
        ans+=(kabu*a[i+1])
        #print(a[i+1],ans)

print(ans)