using static System.Math;
using static System.Console;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System;

namespace AtCoder
{
    class Program
    {
        private static long mod = 1000000007;
        static void Main(string[] args)
        {
            var n = int.Parse(ReadLine());
            var line = ReadLine().Split(' ').Select(value => long.Parse(value)).ToArray();

            long possession = 1000;
            var max = line[0];
            var min = line[0];
            bool? increased = null;

            for(var i = 1; i < n; i++)
            {
                if(line[i] > line[i - 1])
                {
                    if(increased != true)
                    {
                        increased = true;
                        min = line[i - 1];
                    }
                    max = Max(max, line[i]);
                }
                else if(line[i] < line[i - 1])
                {
                    if(increased != false)
                    {
                        if(increased == true)
                        {
                            possession += (possession / min) * (max - min);
                            max = line[i];
                            min = line[i];
                        }
                        increased = false;
                        max = line[i - 1];
                    }
                    min = Min(min, line[i]);
                }
            }

            if(increased == true)
            {
                possession += (possession / min) * (max - min);
            }

            WriteLine(possession);
        }
    }
}
