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

class MainClass
{
    static void Main()
    {
        int N = int.Parse(ReadLine());
        var A = ReadLine().Split().Select(int.Parse).ToArray();

        int max = 0;
        int premoney = 1000;
        int money = 1000;
        int have = 0;
        int index = 0;
        while (index < N - 1)
        {
            while (index < N - 1 && A[index] > A[index + 1])
            {
                index++;
            }
            have = money / A[index];
            money = money % A[index];
            while (index < N - 1 && A[index] < A[index + 1])
            {
                index++;
            }
            money += A[index] * have;
            have = 0;
            index++;
        }
        WriteLine(money);
    }
}
