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

prices = sorted(list(set(a)),key=a.index)


curentVal = 1000
stockNum = 0

for i in range(len(prices)):
    if i == 0:
        if prices[i] < prices[i+1]:
            num = curentVal // prices[i]
            curentVal -= prices[i] * num
            stockNum += num
    elif i == len(prices) - 1:
        if prices[i-1] < prices[i]:
            num = stockNum
            curentVal += prices[i] * num
            stockNum -= num
    elif prices[i] < prices[i+1] and prices[i-1] > prices[i]:
        num = curentVal // prices[i]
        curentVal -= prices[i] * num
        stockNum += num
    elif prices[i] > prices[i+1] and prices[i-1] < prices[i]:
        num = stockNum
        curentVal += prices[i] * num
        stockNum -= num

print(curentVal)