#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define MOD 1000000007
using Graph = vector<vector<int>>;
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;
// 任意長整数型
using Bint = mp::cpp_int;
// 仮数部が1024ビットの浮動小数点数型(TLEしたら小さくする)
using Real = mp::number<mp::cpp_dec_float<1024>>;

int main (){
  int N;
  cin>>N;
  int syoji=1000;
  int kabu=0;
  vector<int>A(N);
  vector<int>B(N,0);
  rep(i,N) cin>>A[i];
  rep(i,N-1){
    B[i]=A[i+1]-A[i];
  }
  rep(i,N){
    if(B[i]<0){
      for(int j=i+1;i<N;i++){
        if(B[j]>0){
      kabu=syoji/A[i];
      syoji=syoji%A[i];
          break;
        }
      }
    }
    else if(B[i]>0){
      syoji+=kabu*A[i];
      kabu=0;
    }
  }
  cout<<syoji;
}
