"""
AtCoder :: M-Solutions Programming Contest 2020 :: Road to Millionaire
https://atcoder.jp/contests/m-solutions2020/tasks/m_solutions2020_d
"""
import sys


def find_buy_day(curr_day, prices):
    for day in range(curr_day, len(prices)-1):
        if prices[day] < prices[day+1]:
            return day
    return -1


def find_sell_day(curr_day, prices):
    for day in range(curr_day, len(prices)-1):
        if prices[day] > prices[day+1]:
            return day
    if prices[-1] > prices[-2]:
        return len(prices)-1
    return -1


def solve(prices):
    """Solve puzzle."""
    prev_yen = yen = 1000
    day = find_buy_day(0, prices)
    while day >= 0:
        prev_yen = yen
        shares, yen = divmod(yen, prices[day])
        day = find_sell_day(day, prices)
        if day == -1:
            return prev_yen
        yen += shares * prices[day]
        day = find_buy_day(day, prices)
    return yen


def main():
    """Main program."""
    N = int(sys.stdin.readline())
    prices = [int(i) for i in sys.stdin.readline().split()]
    print(solve(prices))


if __name__ == '__main__':
    main()
