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) - 1):
    if prices[i] < prices[i+1]:
        num = curentVal // prices[i]
        curentVal -= prices[i] * num
        stockNum += num
    else:
        num = stockNum
        curentVal += prices[i] * num
        stockNum -= num

num = stockNum
curentVal += prices[i+1] * num
stockNum -= num

print(curentVal)