n = int(input())
a = list(map(int,input().split()))
b = [0]*n
c = [0]*n
cash = 1000
stock = 0
#1:底 2:頂点 0:どちらでもない

for i in range(1,n):
    if a[i-1]<a[i]:
        b[i]='+'
    elif a[i-1]>a[i]:
        b[i]='-'
    elif a[i-1]==a[i]:
        b[i]=b[i-1]

if b[1]=='+':
    c[0]=1
elif b[1]=='-':
    c[0]=2

for i in range(1,n-1):
    if b[i]=='+' and b[i+1]=='-':
        c[i]=2
    elif b[i]=='-' and b[i+1]=='+':
        c[i]=1

if b[n-1]=='+':
    c[n-1]=2
elif b[n-1]=='-':
    c[n-1]=1
last = n
ch = 0
for i in range(n):
    if c[n-1-i]==1:
        ch = 1
    elif c[n-1-i]==2 and ch==0:
        break
    elif c[n-1-i]==2 and ch==1:
        last = n-i
        break

for i in range(last):
    if c[i]==1:
        stock += cash//a[i]
        cash -= cash//a[i]*a[i]
    if c[i]==2:
        cash += stock*a[i]
        stock =0
print(cash)
