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

sell = []

for i in range(1, n):
    if a[i - 1] < a[i]:
        sell.append(i)

for i in range(len(sell)):
    if i == 0:
        l = 0
    else:
        l = sell[i - 1] + 1
    r = sell[i] - 1
    stock = ans // min(a[l:r + 1])
    ans += (a[sell[i]] - min(a[l:r + 1])) * stock

print(ans)
