#import sys
#import numpy as np
import math
#from fractions import Fraction
import itertools
from collections import deque
from collections import Counter
#import heapq
from fractions  import gcd
#input=sys.stdin.readline
import bisect
n=int(input())
a=list(map(int,input().split()))
i=0
m=1000
f=True
k=0
M=[1000]
res=[0]*(n-1)
for i in range(1,n):
    if a[i]<a[i-1]:
        res[i-1]=-1
    else:
        res[i-1]=1

for i in range(n):

    if f:
        if res[i]==-1:
            continue 
        else:
            f=False
            
            k=m//a[i]
            m=m%a[i]
    else:
        if i==n-1 or res[i]==-1:
            m=k*a[i]+m
            M.append(m)
            f=True 
        else:
            continue
print(max(M))
        