using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace Tasks
{
    public class D
    {
        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            Solve();
            Console.Out.Flush();
        }

        public static void Solve()
        {
            var N = int.Parse(Console.ReadLine());
            var A = Console.ReadLine().Trim().Split(' ').Select(int.Parse).ToArray();
            var days = new List<int>();
            var prev = 0;
            for (var i = 0; i < A.Length; i++)
            {
                if (prev != A[i]) days.Add(A[i]);
                prev = A[i];
            }
            N = days.Count;
            var buy = new bool[N];
            for (var i = 0; i < N - 1; i++)
            {
                for (var j = i + 1; j < N; j++)
                {
                    if (days[i] < days[j]) buy[i] = true;
                }
            }
            var sell = new bool[N];
            for (var i = 1; i < N - 1; i++)
            {
                for (var j = i + 1; j < N; j++)
                {
                    if (days[i] > days[j]) sell[i] = true;
                }
            }
            sell[N - 1] = true;

            var answer = 1000;
            var stack = 0;
            for (var i = 0; i < N; i++)
            {
                if (!sell[i] && buy[i])
                {
                    if (answer < days[i]) continue;
                    stack += answer / days[i];
                    answer -= stack * days[i];
                }
                else if (sell[i])
                {
                    answer += stack * days[i];
                    stack = 0;
                }
                // Console.WriteLine(answer);
            }

            Console.WriteLine(answer);
        }
    }
}
