#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define tc() ll T;cin>>T;while(T--)

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    
    /*-----------------Code Begins Here------------------*/
    
    ll n; cin>>n;
    ll a[n];
    for(ll i=0;i<n;i++) cin>>a[i];
    ll mini = a[0],maxi = a[0],i=0,ans=1000,flag=1;
    while(i<n){
        mini=200;
        maxi=100;
        while(i<n){
            if(a[i]=<mini){
                mini = a[i];
            }
            else break;
            if(i==n-1) flag=0;
            i++;
        }
        while(i<n){
            if(a[i]>=maxi){
                maxi = a[i];
            }
            else break;
            i++;
        }
        if(flag) ans+=(maxi-mini)*(ans/mini);
        i++;
    }
    cout<<ans;
    
    /*------------------Code Ends Here-------------------*/
    
    return 0;
}
