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 int Answer { get; set; }

        private void dfs(int day, int val, int count)
        {
            if (day == this.N)
            {
                this.Answer = Math.Max(val, this.Answer);
                return;
            }
            else
            {
                // 何もしない
                this.dfs(day + 1, val, count);

                // 売れるだけ売った
                val += this.A[day] * count;
                count = 0;
                this.dfs(day + 1, val, 0);

                // 買えるだけ買った
                var buyCount = val / this.A[day];
                val -= this.A[day] * buyCount;
                count += buyCount;
                this.dfs(day + 1, val, count);
            }
        }

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

            Console.WriteLine(this.Answer);
        }
    }
}
