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>mi:
    money=1000
    for i in range(2*mi):
        if i%2==0:
            k=minl[i//2]
            kabu=money//l[k]
            money-=l[k]*kabu
        else:
            k=maxl[i//2+1]
            money+=l[k]*kabu
    print(money)
else:
    money=1000
    for i in range(2*ma):
        if i%2==0:
            k=minl[i//2]
            kabu=money//l[k]
            money-=l[k]*kabu
        else:
            k=maxl[i//2]
            money+=l[k]*kabu
    print(money)