n = int(input())
A = list(map(int, input().split()))
mny = 1000
Kab = 0
base = 0
typ = 1 # 1なら買いモード、0なら売りモード
if n != 2:
    if A[0] < A[1]:
        kab = mny // A[0]
        mny = mny % A[0]
        typ -= 1
    for i in range(1, n-1):
        if A[base] < max(A[base:]):
            if typ == 1:
                if A[i-1] >= A[i] < A[i+1]:
                    kab = mny // A[i]
                    mny = mny % A[i]
                    typ -= 1
            else:
                if A[i-1] <= A[i] > A[i+1]:
                    mny += kab*A[i]
                    kab = 0
                    base = i
                    typ += 1
        else:
            break
    if typ == 0:
        mny += kab*A[n-1]
else:
    if A[0] < A[1]:
        kab = mny // A[0]
        mny = mny % A[0]
        mny += kab*A[1]
print(mny)