using System;
using System.Collections.Generic;

namespace D
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine(solver());
        }
        static int solver()
        {
            var N = int.Parse(Console.ReadLine());
            var A = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);

            var market = new List<int>();
            market.Add(A[0]);
            for (int i = 1; i < N; i++)
            {
                if (A[i] == A[i - 1]) continue;
                market.Add(A[i]);
            }

            N = market.Count;
            var infection = new List<int>();
            if (A[0] < A[1]) infection.Add(0);
            for (int i = 1; i < N - 1; i++)
            {
                if (((market[i] > market[i - 1]) && (market[i] > market[i + 1])) || ((market[i] < market[i - 1]) && (market[i] < market[i + 1])))
                {
                    infection.Add(i);
                }
            }
            if (market[N - 1] > market[N - 2]) infection.Add(N - 1);

            if (infection.Count == 0) return 1000;

            var money = 1000;
            var stock = 0;
            for (int i = 0; i + 1 < infection.Count; i += 2)
            {
                var purchase = money / market[infection[i]];
                money -= purchase * market[infection[i]];
                stock += purchase;

                money += stock * market[infection[i + 1]];
                stock = 0;
            }
            return money;
        }
    }
}
