using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
class d{
    public static void Main(){
        int n = int.Parse(Console.ReadLine());
        int[] a = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
        int money = 1000;
        int stock = 0;
        for(int i=0; i<n-1; i++){
            if(a[i] < a[i+1]){
                stock += money/a[i];
                money %= a[i];
            }
            if(a[i] > a[i+1]){
                money += stock * a[i];
                stock = 0;
            }
        }
        money += stock * a[n-1];
        Console.WriteLine(money);
    }
}
