#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]
while True:
    if i==n-1:
        break
    if f:
        for j in range(i+1,n):
            if a[j]>a[i]:
                m=(m//a[i])*a[j]+(m%a[i])
                i=j
                M.append(m)
                f=False
                break
        else:
            break
    else:
        for j in range(i+1,n):
            if a[j]<a[i]:
                i=j
                f=True
                break
        else:
            break
print(max(M))