ma = lambda :map(int,input().split())
ni = lambda:int(input())
yn = lambda fl:print("Yes") if fl else print("No")
import collections
import math
import itertools
import heapq as hq
def tsune(pal,R,pre):
    c = 0
    ud = [0 for i in range(n)]
    for i in range(n):
        r = R[i]
        if pal*r > pal*pre:
            pal*=-1
            ud[i] = pal
        pre =r
    return  ud

def tot(ud):
    tmp = 1000
    kab = 0
    for i in range(n):
        if ud[i] ==1: #buy kab
            kab,tmp = divmod(tmp,A[i])
        elif ud[i] ==-1:
            tmp +=kab*A[i]
            kab = 0
    return tmp
n = ni()
A = list(ma())
ans = 0
ud = tsune(-1,A,1000)
tmp = tot(ud)
ans = max(ans,tmp)
ud = tsune(-1,A,0)
tmp = tot(ud)
ans = max(ans,tmp)
ud = tsune(1,A,1000)
tmp = tot(ud)
ans = max(ans,tmp)
ud = tsune(1,A,0)
tmp = tot(ud)
ans = max(ans,tmp)
print(ans)
