using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;

class Program
{
    static void Main(string[] args)
    {
        var n = int.Parse(Console.ReadLine());

        var nums = Console.ReadLine().Split(' ');
        var array = new int[nums.Count()];
        
        for(var i = 0; i < nums.Count(); i++)
        {
            array[i] = int.Parse(nums[i]);
        }

        var hasStock = false;
        var money = 1000;
        var stockCount = 0;

        for(var i = 1; i< n + 1; i++)
        {
            if (i != n)
            {
                if (!hasStock)
                {
                    if (array[i - 1] < array[i])
                    {
                        stockCount = money / array[i - 1];
                        money = money % array[i - 1];
                        hasStock = true;
                    }
                }
                else
                {
                    if (array[i - 1] > array[i])
                    {
                        money = money + array[i - 1] * stockCount;
                        stockCount = 0;
                        hasStock = false;
                    }
                }
            }
            else
            {
                if(stockCount > 0)
                {
                    money = money + array[i - 1] * stockCount;
                }
            }

        }
        Console.WriteLine(money);
        Console.ReadLine();
    }


}


