using System;
using System.Linq;
 
class D
{
    static void Main()
    {
        int N = int.Parse(Console.ReadLine());
        var A = (Console.ReadLine()).Split(' ').Select(s => int.Parse(s)).ToArray();

        decimal Sum = 1000;
        decimal Stock = 0;

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