N = int(input())
A = [int(i) for i in input().split()]

max = 1000
for i in range(2**(N-1)):
    possess = 1000
    for j in range(N-1):
        if (i >> j) & 1:
            stock = possess // A[j]
            possess = possess % A[j] + A[j+1] * stock
    if possess > max:
        max = possess

print(max)