#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]

for s in range(1,n):
    if a[s]>a[i]:
      break
    i=s 
while True:
    if i==n-1:
        break
    if f:
        for j in range(i+1,n):
            if a[j]>a[i]:
                check=True
                x=j
                for l in range(j+1,n):
                    if a[l]<a[j]:
                        break
                    else:
                        x=l
                if check:
                    m=(m//a[i])*a[x]+(m%a[i])
                    i=x
                    M.append(m)
                    f=False
                    break
        else:
            break
    else:
        for j in range(i+1,n):
            if a[j]<a[i]:
                x=j
                for l in range(j+1,n):
                    if a[l]>a[j]:
                        break
                    else:
                        x=l
                i=x
                f=True
                break
        else:
            break
print(max(M))