from collections import deque
n=int(input())
l=list(map(int,input().split()))
maxl=[]
minl=[]
for i in range(n):
    if i==0:
        if l[0]>l[1]:
            maxl.append(0)
        elif l[0]<l[1]:
            minl.append(0)
    elif i==n-1:
        if l[n-2]<l[n-1]:
            maxl.append(n-1)
    else:
        if l[i-1]<l[i] and l[i]>=l[i+1]:
            maxl.append(i)
        elif l[i-1]>l[i] and l[i]<=l[i+1]:
            minl.append(i)

ma=len(maxl)
mi=len(minl)
if ma!=0 and mi!=0 and maxl[0]<minl[0]:
    maxl.remove(maxl[0])
maxx=deque()
minn=deque()
for i in maxl:
    maxx.append(i)
for i in minl:
    minn.append(i)
try:
    maa=maxx.popleft()
except:
    maa=100
try:
    mii=minn.popleft()
except:
    mii=100
money=1000
while True:
    if maa>mii and maa!=100:
        kabu=money//l[mii]
        money-=l[mii]*kabu
        if minn:
            mii=minn.popleft()
        else:
            mii=100
    elif maa<mii:
        money+=l[maa]*kabu
        kabu=0
        if maxx:
            maa=maxx.popleft()
        else:
            maa=100
    else:
        break   
print(money)