using System;
using System.Collections.Generic;
using System.Linq;

public class Solution
{
    public static void Main()
    {
        var N = int.Parse(Console.ReadLine());
        var A = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        long yen0 = 0;
        long stock0 = 0;
        long yen1 = 0;
        long stock1 = 0;

        yen0 = 1000;
        foreach (var a in A)
        {
            long nextYen0 = yen0;
            long nextStock0 = stock0;
            long nextYen1 = yen1;
            long nextStock1 = stock1;

            // 0 買い
            {
                var yen = yen0;
                var stock = stock0;
                stock += yen / a;
                yen %= a;

                if (stock >= nextStock1)
                {
                    nextStock1 = stock;
                    nextYen1 = Math.Max(nextYen1, yen);
                }
            }
            // 0 売り
            {
                var yen = yen0;
                var stock = stock0;
                yen += stock * a;
                nextYen0 = Math.Max(nextYen0, yen);
            }
            // 1 買い
            {
                var yen = yen1;
                var stock = stock1;
                stock += yen / a;
                yen %= a;

                if (stock >= nextStock1)
                {
                    nextStock1 = stock;
                    nextYen1 = Math.Max(nextYen1, yen);
                }
            }
            // 1 売り
            {
                var yen = yen1;
                var stock = stock1;
                yen += stock * a;
                nextYen0 = Math.Max(nextYen0, yen);
            }

            yen0 = nextYen0;
            yen1 = nextYen1;
            stock0 = nextStock0;
            stock1 = nextStock1;
        }

        Console.WriteLine(yen0);
    }
}