#include<iostream>
#include<vector>
#include<bits/stdc++.h>
using namespace std;

int main(){
  long n;
  //int temp;
  long syoji=1000;
  //long kabun;//kabukin,
  //int kattaflag;
  cin >> n;
  vector<long> a(n,0);
  for(int i=0;i<n;i++){
    cin >> a.at(i);
  }
  //cout << "hahaha" << endl;
  /*if(a.at(0)<a.at(1)){
    kattaflag=1;//次売る
  }else{
    kattaflag=-1;//次買う
  }*/
  //kabun=0;
  //temp=0;
  //kabukin=0;

  for(int i=0;i<n-1;i++){
    //temp=0;
    long long kabun=0;
    if(a.at(i)<a.at(i+1)){//買う
      //kabukin=a.at(i);
      //kabun=0;
      /*while(syoji>=a.at(i)){//(temp+=a.at(i))<=syoji){
        syoji-=a.at(i);
        kabun++;
      }*/
      //syoji-=a.at(i)*kabun;
      kabun=syoji/a.at(i);
      syoji=syoji-(a.at(i)*kabun);
    }else if(a.at(i)>a.at(i+1)){//売る
      while(kabun>0){
        syoji+=a.at(i);
        kabun--;
      }
      //kabukin=0;
    }
    //cout << i << ":" << kabukin << endl;
  }
  if(kabun>0){
    //while(kabun>0){
      syoji=syoji+(a.at(n-1)*kabun);
      //kabun--;
    //}
  }
  cout << syoji << endl;

  return(0);
}
