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

class Program
{
    static void Main(string[] args)
    {
        var N = long.Parse(ReadLine());
        var A = ReadLine().Split(' ').Select(s => long.Parse(s)).ToArray();

        var money = 1000L;
        var stock = 0L;

        var diff = new long[N];

        for (int i = 0; i < N; i++)
        {
            if (i < N - 1)
                diff[i] = A[i + 1] - A[i];
            else
                diff[i] = -1;
        }

        for (int i = 0; i < N; i++)
        {
            // buy
            if (diff[i] > 0)
            {
                while (A[i] <= money)
                {
                    money -= A[i];
                    stock++;
                }
            }
            // sell
            else if (diff[i] < 0)
            {
                while (1 <= stock)
                {
                    money += A[i];
                    stock--;
                }
            }
        }

        WriteLine(money);
    }
}
