ing namespace std;
using ll = long long;

int main(){
    int n;
    cin >> n;
    vector<int> a(n,0);
    for(int i = 0;i < n;i++){
        cin >> a[i];
    }
    ll gold = 1000;
    int kb = 0;
    
    for(int i = 0;i < n;i++){
        for(int k = i+1;k < n;k++){
            if(a[i] < a[k]){
                kb = gold/a[i];
                gold = gold - a[i]*kb;
                gold = gold + a[k]*kb;
                kb = 0;
                i = k;
                
            }else if(a[i] > a[k]){
                i = k;
                break;
            }
        }
    }
    cout << gold << endl;
}
