//Californium
#include<bits/stdc++.h>
using namespace std;
#define int long long
int main(){
  long long N;cin>>N;
  vector<long long>v(N);
  vector<string>Q(N);
  for(int X=0;X<N;X++){
    cin>>v[X];
  }
  string rast="";
  if(v[0]<v[1]){
      Q[0]="kai";
      rast="kai";
  }
  for(long long X=0;X<N;X++){
    if(X>0&&X<N-1){
      if(v[X]>=v[X-1]&&v[X]>v[X+1]){
        Q[X]="uri";
        rast="uri";
      }
      else if(v[X]<=v[X-1]&&v[X]<v[X+1]){
        Q[X]="kai";
        rast="kai";
      }
    }
    else if(X==N-1&&rast=="kai"){
      Q[X]="uri";
    }
  }
  long long kabu=0;
  long long kane=1000;
  for(long long X=0;X<N;X++){
    if(Q[X]=="kai"){
      kabu+=kane/v[X];
      kane-=kabu*v[X];
    }
    else if(Q[X]=="uri"){
      kane+=kabu*v[X];
      kabu=0;
    }
  }
  cout<<kane<<endl;
}
