n = int(input())
a = [int(i) for i in input().split()]
wallet = 1000
stock = 0
price = 0
for i in range(n - 1):
    if a[i] < a[i + 1]:
        price = a[i]
        stock += (wallet // price)
        wallet -= (price * stock)
    elif a[i] > a[i + 1]:
        price = a[i]
        wallet += (price * stock)
        stock = 0
if stock != 0:
    wallet += (a[- 1] * stock)
print(wallet)