n = int(input())
A = list(map(int, input().split()))
money = 1000
stocks = 0
down = 1
for i in range(n-1):
    # 下がってるけど次上がる→買う
    if down and A[i+1] > A[i]:
        down = -1
        stocks = money // A[i]
        money %= A[i]
        # 最後から二日目なら売る
        if i == n-2:
            money += A[i+1] * stocks
            stoks = 0
    # 上がってるけど次下がる→売る
    elif down == -1 and A[i+1] < A[i]:
        down = 1
        money += A[i] * stocks
        stoks = 0
print(money)