#include <bits/stdc++.h>   
#define rep(i, n) for(long long int i = 0; i < n; i++)
#define _rep(i, m, n) for(long long int i = m; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const ll mod = 1000000007;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
     
ll gcd(ll A, ll B){
    if(B == 0)return A;
    return gcd(B, A % B);
}
ll lcm(ll A, ll B){
    return A * B / gcd(A, B);
}
using Graph = vector<vector<int>>;
Graph G;


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int n; cin >> n;
    vector<int> a(n);
    rep(i, n) cin >> a[i];
    vector<int> b;
    b.push_back(a[0]);

    bool flag = false;
    int i = 0;
    while(i < n - 1){
        int MAX = 0, MIN = 201;
        if(!flag and a[i] <= a[i + 1]){
            while(i < n - 1 and a[i] <= a[i + 1]){
                i++;
                MAX = a[i];
            }
        }else if(flag and a[i] >= a[i + 1]){
            while(i < n - 1 and a[i] >= a[i + 1]){
                i++;
                MIN = a[i];
            }
        }
        if(!flag and MAX != 0){
            b.push_back(MAX);
            flag = true;
        }else if(flag and MIN != 210){
            b.push_back(MIN);
            flag = false;
        }else{
            i++;
        }
    }
    if(b.size() == 1){
        cout << 1000 << endl;
        return 0;
    }
    int ans = 1000;
    int kabu = 0;
    rep(i, b.size()){
        if(i == b.size() - 1 and b.size() % 2 != 0) break;
        if(i % 2 == 0){
            kabu = ans / b[i];
            ans -= b[i] * kabu;
        }else{
            ans += b[i] * kabu;
            kabu = 0;
        }
    }
    cout << ans << endl;
    return 0;
}