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
n = ni()
A = list(ma())
tot = 1000
kab = 0
for i in range(n-1):
    tot += A[i]*kab
    if A[i] > A[i+1]:
        pass
    if A[i] <= A[i+1]:#ここで換金して次に増えるなら
         tot,kab = divmod(A[i],tot)
tot+=A[-1]*kab
print(tot)
