n= int(input())
a = list(map(int,input().split()))
s=0
k=0
top=[]
bottom=[]
t=0
ans=1000
ka=0
while a[s]==a[s+1] and s<n-1:
    s+=1
if s==n-1:
    print(ans)
else:
    if a[s]>a[s+1]:
        k=-1
        t=1
    else:
        k=1

    while s<n-1:
        while a[s]*k <= a[s+1]*k and s<n-1:
            s+=1
            if s==n-1:
                break
        if k ==-1:
            bottom.append(a[s])
        else:
            top.append(a[s])
        k *= -1
        s+=1
    if k == 1:
        top.append(a[-1])
    else:
        bottom.append(a[-1])
    if t==1:
        for i in range(len(top)):
            ka+=ans//bottom[i]
            ans = ans % bottom[i]
            ans += ka*top[i]
            ka = 0
    else:
        for i in range(len(top)):
            
            if i== 0:
                ka += ans // a[i]
                ans = ans % a[i]
                ans += ka * top[i]
                ka = 0
            else:
                ka+=ans//bottom[i-1]
                ans = ans % bottom[i-1]
                ans += ka*top[i]
                ka = 0
    print(ans)