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

namespace MyProject
{
    class Program
    {
        static void Main(string[] args)
        {
#if Local
            var sw = new Stopwatch();
            sw.Start();
            Console.SetIn(new StreamReader("input.in"));
#endif

            var solver = new Solver();
            solver.Solve();
#if Local
            Console.WriteLine($"{sw.ElapsedMilliseconds}ms");
#endif
        }
    }

    class Solver
    {
        public int N { get; set; }
        public List<int> A { get; set; }

        public void Solve()
        {
            this.N = int.Parse(Console.ReadLine());
            this.A = Console.ReadLine().Split().Select(elem => int.Parse(elem)).ToList();

            int val = 1000;
            int count = 0;
            foreach (var i in Enumerable.Range(0, this.N))
            {
                int next = i == this.N - 1 ? 0 : this.A[i + 1];
                if (this.A[i] < next)
                {
                    // 買う
                    var buyCount = val / this.A[i];
                    val -= this.A[i] * buyCount;
                    count += buyCount;
                }
                else
                {
                    // 売る
                    val += this.A[i] * count;
                    count = 0;
                }
            }

            Console.WriteLine(val);
        }
    }
}
