#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include "bits/stdc++.h"
#define pi (3.141592653589)
#define mod 1e9 + 7
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define ff first
#define ss second
#define all(c) c.begin(), c.end()
#define mint(a, b, c) min(c, min(a, b))
#define minf(a, b, c, d) min(d, min(c, min(a, b)))
#define maxt(a, b, c) max(c, max(a, b))
#define maxf(a, b, c, d) max(d, max(c, max(a, b)))
#define vi vector<int>
#define vul vector<unsigned long long int>
#define vll vector<long long int>
#define oset tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
#define fast ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr)
using namespace __gnu_pbds;
using namespace std;
typedef unsigned long long int ul;
typedef long long int ll;
int main()
{
    fast;
    int n;
    cin >> n;
    vi a(n);
    for (int i = 0; i < n; i++)
        cin >> a[i];
    int check = 0;
    int m;
    int stock = 0;
    int money = 1000;
    for (int i = 0; i < n; i++)
    {
        if (check == 0)
        {
            m = a[i];
            for (i = i + 1; i < n && a[i] <= a[i - 1]; i++)
            {
                if (a[i] < m)
                    m = a[i];
            }
            i--;
            if (i < n - 1)
            {
                stock = money / a[i];
                money -= (stock * a[i]);
            }
            check = 1;
        }
        else if (check == 1)
        {
            m = a[i];
            for (i = i + 1; i < n && a[i] >= a[i - 1]; i++)
            {
                if (a[i] > m)
                    m = a[i];
            }
            i--;
            money += stock * a[i];
            stock = 0;
            check = 0;
        }
    }
    cout << money;
    return 0;
}