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

ans = 1000
buy = -1
for bit in range(2 ** n):
    money = 1000
    stock = 0
    for i in range(n):
        if (bit >> i) & 1:
            buy = i
            stock += money // A[i]
            money -= A[i] * (money // A[i])
        else:
            if buy == -1:
                continue
            elif A[buy] < A[i]:
                money += stock * A[i]
                stock = 0
    money += stock * A[-1]
    if money > ans:
        ans = money

print(ans)
