import sys
import heapq
import math
import fractions
import bisect
import itertools
from collections import Counter
from collections import deque
from operator import itemgetter
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

n=int(input())
a=lmp()
a.insert(0,10000)
a.append(0)
l=[0]*(n+2)
for i in range(1,n+1):
    if a[i-1]<a[i]>=a[i+1]:
        l[i]=1
    elif a[i-1]>a[i]<=a[i+1]:
        l[i]=-1
sto=[0,1000]
for i in range(n+2):
    if l[i]==-1:
        sto[0],sto[1]=divmod(sto[1],a[i])
    if l[i]==1:
        sto[1]+=sto[0]*a[i]
        sto[0]=0
if sto[0]!=0:
    for i in range(n+2):
        if l[n+2-i]==-1:
            print(sto[1]+sto[0]*a[n+2-1])
            exit()
else:
    print(sto[1])