#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define pi 3.14159265358979323846
#define mm 1000000007
int main()
{
    IOS;
    ll a,b,c,d,e,k,count,ru=1000,last;
    cin>>a;
    ll A[a+1]={0};
    for(b=0;b<a;b++)
    {
        cin>>A[b];
    }
    for(b=0;b<a-1;b++)
    {
        while(A[b+1]<=A[b] && b<a-1) b++;
           count=ru/A[b];
           ru=ru%A[b];
           last=A[b];
        while(A[b+1]>=A[b] && b<a-1) b++;
        if(b<a && A[b]>A[b-1])
        {
            ru=ru+count*A[b];
            count=0;
        }
    }
    if(count==0)
    cout<<ru<<endl;
    else
    cout<<ru+(last*count)<<endl;
}