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 = 201;
            for (var i = 0; i < A.Length; i++)
            {
                if (days.Count % 2 == 0)
                {
                    var tmp = prev;
                    for (var j = i; j < A.Length; j++)
                    {
                        if (A[j] <= tmp) tmp = A[j];
                        else
                        {
                            i = j - 1;
                            break;
                        }
                    }
                }
                else
                {
                    var tmp = prev;
                    for (var j = i; j < A.Length; j++)
                    {
                        if (A[j] >= tmp) tmp = A[j];
                        else
                        {
                            i = j - 1;
                            break;
                        }
                    }
                }
                prev = A[i];
                days.Add(prev);
            }
            // Console.WriteLine(string.Join(" ", days));
            if (days.Count % 2 == 1) days.RemoveAt(days.Count - 1);
            var answer = 1000;
            var stock = 0;
            for (var i = 0; i < days.Count; i++)
            {
                if (i % 2 == 0)
                {
                    stock += answer / days[i];
                    answer -= stock * days[i];
                }
                else
                {
                    answer += stock * days[i];
                    stock = 0;
                }
            }

            Console.WriteLine(answer);
        }
    }
}
