using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;

namespace ABC
{
    class MPCO2020D
    {
        const string FILE = "/tmp/data.txt";

        static void Main(string[] args)
        {
#if DEBUG
            Console.SetIn(new StreamReader(FILE));
#endif
            var N = RI();
            var A = RIa(N);

            var amount = 1000;
            int nstock = 0;
            for (int d = 0; d < N; ++d)
            {                
                if (nstock == 0)
                {
                    for (int nd = d; nd < N; ++nd)
                    {
                        if (A[nd + 1] > A[nd])
                        {   // nd に買う
//                            Console.WriteLine("L:" + nd);
                            nstock = amount / A[nd];
                            amount = amount % A[nd];
                            d = nd;
                            break;
                        }
                    }
                }
                else
                {
                    for (int nd = d; nd < N + 1; ++nd)
                    {
                        if (A[nd + 1] < A[nd])
                        {   // nd に売る
//                            Console.WriteLine("S:" + nd);
                            amount += nstock * A[nd];
                            nstock = 0;
                            d = nd;
                            break;
                        }
                    }
                }
            }
            Console.WriteLine(amount);

#if DEBUG
            Console.WriteLine("*** end ***");
            Console.SetIn(Console.In);
            Console.ReadKey();
            Console.WriteLine();
#endif
        }

        static int RI()
        {
            return int.Parse(Console.ReadLine());
        }

        static int[] RIa(int n)
        {
            string[] sa = Console.ReadLine().Split(' ');
            int[] la = new int[n + 1];
            for (int i = 0; i < n; ++i)
            {
                la[i] = int.Parse(sa[i]);
            }
            la[n] = int.MinValue;
            return la;
        }
    }
}
