#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cstdlib>
#include <map>
#include <math.h>
#include <numeric>
#include <iomanip>
#include <climits>
using namespace std;
int main(){
  int n;
  cin >> n;
  int money=1000;
  int price[n]={0};
  for(int i=0;i<n;i++){
    cin >> price[i];
  }
  int stock=0;
  int amari=0;
  for(int i=0;i<n;i++){
    if(stock==0){
      if(price[i+1]>price[i]){
        stock=money/price[i];
        amari=money%price[i];
      }
    }else{
      if((i<n-1&&price[i+1]<price[i])||i==n-1){
        money=amari+stock*price[i];
        stock=0;
        amari=0;
      }
    }
  }
  cout << money  << endl;
}