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


class Program
{
    static void Main(string[] args)
    {
        // 入力
        //var s = Console.ReadLine();
        var n = int.Parse(Console.ReadLine());
        int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();

        int[] flag = new int[n];
        flag[0] = 0;
        for (int i = 1; i < n; i++)
        {
            if (a[i - 1] <= a[i]) flag[i] = 1;
            else flag[i] = -1;
        }

        var ans = 1000;
        var num = 0;
        for (int i = 0; i < n-1; i++)
        {
            if (flag[i + 1] == 1)
            {
                if(ans >= a[i])
                {
                    num += ans / a[i];
                    ans -= num * a[i];
                }

            }
            else
            {
                if (num > 0)
                {
                    ans += num * a[i];
                    num = 0;
                }
            }

            if(i + 1 == n - 1)
            {
                if (num > 0)
                {
                    ans += num * a[i+1];
                    num = 0;
                }
            }
        }

        // 出力
        Console.WriteLine(ans);
    }
}