#include<bits/stdc++.h>
#include<vector>
#include<math.h>
#include<string.h>
using namespace std;
#define MOD 1000000007
#define MAX 200005
#define PMAX 55
#define PRECISION 0.00000000001
#define INF 2000000000
#define FASTIO ios_base::sync_with_stdio(false);cin.tie(NULL)
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
int a[MAX];
bool top[MAX],bottom[MAX];
int main()
{
    int n,i,j,k=0,money=1000,price=0;
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
    }
    for(i=0;i<n;i++)
    {
        if(i==0)
        {
            top[i]=(a[i]>=a[i+1]);
            bottom[i]=(a[i]<=a[i+1]);
        }
        else if(i==n-1)
        {
            top[i]=(a[i]>=a[i-1]);
            bottom[i]=(a[i]<=a[i-1]);
        }
        else
        {
            top[i]=(a[i]>=a[i+1]&&a[i]>=a[i-1]);
            bottom[i]=(a[i]<=a[i+1]&&a[i]<=a[i-1]);
        }
    }
    for(i=0;i<n;i++)
    {
        if(bottom[i])
        {
            k=k+(money/a[i]);
            money=money-(money/a[i])*a[i];
        }
        if(top[i]||i==n-1)
        {
            money=money+k*a[i];
            k=0;
        }
        //printf("i=%d, k=%d, money=%d, price=%d\n",i,k,money,price);
    }
    printf("%d",money);
    return 0;
}
