class D
{
    static void Main()
    {
        int N = int.Parse(Console.ReadLine());
        //var x = (Console.ReadLine()).Split(' ');

        //int N = int.Parse(x[0]);
        //int K = int.Parse(x[1]);

        //string[] y = (Console.ReadLine()).Split(' ');
        var A = (Console.ReadLine()).Split(' ').Select(s => int.Parse(s)).ToArray();

        int Sum = 1000;
        int Stock = 0;
        //int BuyPrice = 0;

        //if (A[0] < A[1])
        //{
        //    Stock = Sum / A[0];
        //    Sum = Sum % A[0];
        //}
        //BuyPrice = A[0];

        for (int i = 1; i < N - 1; i++)
        {
            //if(A[i + 1] < A[i])
            if (Stock ==0 && A[i - 1] <= A[i] && A[i + 1] < A[i])
            {
                Sum = Sum + A[i] * Stock;
                Stock = 0;
            }
            else if (Stock != 0 &&  A[i - 1] >= A[i] && A[i + 1] > A[i])
            {
                Stock = Sum / A[i];
                Sum = Sum % A[i];
            }
        }
        if (Stock != 0)
        {
            Sum = Sum + A[A.Length - 1] * Stock;
            Stock = 0;
        }
        Console.WriteLine(Sum.ToString());
    }
}