#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

#define F first
#define S second
#define pb push_back
#define eb emplace_back
#define PI 3.14159265359
#define sz(c) (int)c.size()
#define len(c) (int)c.length()
#define hcf(a, b) __gcd(a, b)
#define all(c) c.begin(), c.end()
#define vint vector<int>
#define vll vector<ll>
#define vpint vector<pair<int, int>>
#define vpll vector<pair<ll, ll>>
#define fr(it, a, b) \
    for (int it = (a); it < (b); it++)
#define tr(con, it) \
    for (auto it = con.begin(); it != con.end(); it++)
#define present(con, ele) (con.find(ele) != con.end())
#define cpresent(con, ele) (find(all(con), ele) != con.end())
#define maximum(a, b, c) (a > b ? (a > c ? a : c) : (b > c ? b : c))
#define minimum(a, b, c) (a < b ? (a < c ? a : c) : (b < c ? b : c))
typedef unsigned long long lu;
typedef pair<int, int> pi;
typedef long long ll;
typedef long double lf;
const ll mod = 1e9 + 7;
vector<int> d(100);
void dp(int idx, vint &a)
{
    d[idx] = 0;
    for (int i = 0; i < idx; i++)
    {
        d[idx] = max(d[idx], d[i]);
    }
    for (int i = 0; i < idx; i++)
    {
        if (a[idx] > a[i])
        {
            d[idx] = max(d[idx], (d[i] / a[i]) * a[idx] + d[i] % a[i]);
        }
    }
}
int32_t main()
{
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin >> n;
    vint a(n);
    fr(i, 0, n)
    {
        cin >> a[i];
    }
    d[0] = 1000;
    for (int i = 1; i < n; i++)
    {
        dp(i, a);
    }
    cout << d[n - 1] << "\n";
    return 0;
}