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

now = 1000
a = 0
ans = []


for i in range(2**N):
    now = 1000
    a = 0
    for j in range(N):
        if i >> j & 1:
            if now < A[j] or (j != N-1 and A[j] == A[j+1]):
                continue
            t = now // A[j]
            a += t
            now -= A[j] * t
        else:
            if j != N-1 and A[j] == A[j+1]:
                continue
            now += a * A[j]
            a = 0
    now += a * A[-1]
    ans.append(now)

print(max(ans))