using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ABC0613
{
    class Program
    {
        static void Main(string[] args)
        {
            
            int n = int.Parse(Console.ReadLine());
            int[]array=Console.ReadLine().Split().Select(int.Parse).ToArray();
            int cash = 1000;int kabu = 0;
            int f = 0;//0のとき買う
            for(int i=0;i<n-1;i++)
            {
                if (array[i]<array[i+1]&&f==0)
                {
                    int buy= (int)Math.Floor((double)cash / array[i]);
                    cash -= buy * array[i];
                    kabu = buy;
                    f = 1;
                }

                if(array[i] > array[i + 1] && f == 1)
                {
                    kabu = 0;
                    cash += kabu * array[i];
                    f = 1;

                }
            }
            Console.WriteLine(cash);
        }
    }
}
