n = int(input())
A = list(map(int, input().split()))
ans = 1000
for ii in range(2 ** n):
    tmp = 1000
    kab = 0
    action = 'buy'
    for i in range(n):
        if (ii >> i) & 1:
            if action == 'buy':
                if tmp < A[i]:
                    break
                kab += tmp // A[i]
                tmp = tmp % A[i]
                action = 'sell'

            elif action == 'sell':
                if kab == 0:
                    break
                tmp += kab * A[i]
                kab = 0
                action = 'buy'
    else:
        ans = max(ans, tmp)

print(ans)
