#!/usr/bin/env python3
n = int(input())
a = list(map(int, input().split()))
# init
tmp = a[0]
bit_buy = 1
init_bit = 1
money = 1000
ans = money
stock_num = 0
for i in range(1, n):
    if bit_buy and a[i] > a[i - 1]:
        # a[i-1] で現在の所持金で変えるだけ買う
        # ただし最後は買わない。
        stock_num = money // a[i - 1]
        money = money - stock_num * a[i - 1]
        tmp = a[i - 1]
        bit_buy = 0
        init_bit = 0
    if (init_bit and i == n - 1) or (bit_buy == 0 and (a[i] < a[i - 1])):
        # 全部うる
        money += stock_num * a[i - 1]
        ans = max(ans, money)
        bit_buy = 1
        stock_num = 0
    print(i, a[i], money)
money += stock_num * tmp
ans = max(ans, money)
print(ans)
