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

class Program
{
    static void Main() => new Program().Solve();

    public void Solve()
    {
        int n = ReadInt();
        int[] a = ReadInt(n).ToArray();
        int money = 1000;
        int stock = 0;
        for (int i = 0; i < n - 1; i++)
        {
            if (a[i] < a[i + 1])
            {
                int x = money / a[i];
                money -= x * a[i];
                stock += x;
            }
            else if (a[i] > a[i + 1])
            {
                money += stock * a[i];
                stock = 0;
            }
        }
        Console.WriteLine(money + stock * a[^1]);
    }
}

static class Scanner
{
    static Queue<string> que = new Queue<string>();
    public static string Read() { if (!que.Any()) foreach (var s in Console.ReadLine().Split()) que.Enqueue(s); return que.Dequeue(); }
    public static int ReadInt() => int.Parse(Read());
    public static IEnumerable<string> Read(long n) { for (long i = 0; i < n; i++) yield return Read(); }
    public static IEnumerable<int> ReadInt(long n) => Read(n).Select(int.Parse);
}
