#include <bits/stdc++.h>
#include <math.h>
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rrep(i, n) for(int i = 0; i <= (n); i++)
using namespace std;
typedef long long ll;
 
const ll INF = 1LL<<62;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
// 多次元 vector 生成
template<class T>
vector<T> make_vec(size_t a){
    return vector<T>(a);
}
template<class T, class... Ts>
auto make_vec(size_t a, Ts... ts){
  return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}

const int MOD = 1000000007;


vector<int> A;
int ans = 0;
int N;
void dfs(int count, int money, int day){
    ans = max(ans, money);
    //cout << day << endl;
    if (day == N) return;
    dfs(count,money,day+1);
    int mc = count;
    int m = money;
    if (m > A[day]){
        int buy_count = m / A[day];
        dfs(count+buy_count, money-A[day]*buy_count, day+1);
    }
    /*
    while(m > A[day]){
        m -= A[day];
        mc++;
        dfs(mc, m, day+1);
    }
    */
    /*
    int sc = count;
    int sm = money;
    */
    if (count > 0){
        //int sell_count = sc;
        dfs(0, money+A[day]*count, day+1);
    }
    /*
    while(sc > 0){
        sm += A[day];
        sc--;
        dfs(sc, sm, day+1);
    }
    */
}

int main(){
    cin >> N;
    A.assign(N,0);
    rep(i,N) cin >> A[i];

    int money = 1000;

    dfs(0, money, 0);

    cout << ans << endl;
}

