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

stock=0
money=1000
#極小は-1、極大は1、何もしないは0
graph=[0]*n
if a[0]<a[1]:
    graph[0]=-1
    increase=1
elif a[0]==a[1]:
    increase=0
else:
    increase=-1

for i in range(1,n-1):
    #株価上昇中
    if increase==1:
        if a[i]>a[i+1]:
            graph[i]=1
            increase=-1
    #株価下落中
    if increase==-1:
        if a[i]<a[i+1]:
            graph[i]=-1
            increase=1
    if increase==0:
        if a[i]<a[i+1]:
            graph[i]=-1
            increase=1
        if a[i]>a[i+1]:
            graph[i]=1
            increase=-1

if a[n-2]<a[n-1]:
    graph[n-1]=1

for i in range(n):
    if graph[i]==-1:
        stock=money//a[i]
        money-=a[i]*stock
    if graph[i]==1:
        money+=a[i]*stock
        stock=0

print(money)
