using System;
using System.Linq;

namespace D
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] A = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            int sum = 1000;
            int Kabu = 0;
            for (int i = 0; i < n-1; i++)
            {
                if (A[i] < A[i + 1])
                {
                    //買う
                    Kabu = sum / A[i];
                    sum  %= A[i];
                    //売る
                    sum += (A[i + 1] * Kabu);
                    Kabu = 0;
                }
            }
            Console.WriteLine(sum);
        }
    }
}
