import math

N=int(input())
A=list(map(int, input().split()))

a = A[0]
b = 0
c = 0
d = 1000

if a < A[1]:
    c = math.floor(d/a)
    d = d - (a*c)
    b = 1

for i in range(1,N-1):
    if b == 0:
        if A[i-1] > A[i] and A[i+1] >= A[i]:
            c = math.floor(d/A[i])
            d = d - (A[i]*c)
            b = 1
    else:
        if A[i-1] <= A[i] and A[i+1] < A[i]:
            d = d + (A[i]*c)
            c = 0
            b = 0
            
if A[N-2] < A[N-1]:
    d = d + (A[N-1]*c)

print(d)