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

A.append(0)

B = []
f = True
for i in range(N):
    if f:
        if A[i] < A[i+1]:
            B.append(A[i])
            f = False
    else:
        if A[i] > A[i+1]:
            B.append(A[i])
            f = True


if len(B) == 0:
    print(1000)
else:
    res = 1000
    xx = len(B)//2+1
    B = [0]+B+[10**10]
    for i in range(2**xx):
        en = 1000
        ka = 0
        for j in range(xx):
            if (i>>j)&1:
                en += ka*B[j*2]
                ka = 0
                ka = en//B[j*2+1]
                en = en%B[j*2+1]
        else:
            res = max(en, res)

    print(res)