//設定言語check
#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <limits.h>
#include <algorithm>
#include <iomanip>
#include <math.h>
using namespace std;

int main(){
  int N, K, have = 0, money = 1000, kabu = 0, ans = 0 ;
  cin >> N ;
  int A[N], com[N] = {} ;
  for(int i=0;i<N;i++){
    cin >> A[i] ;
  }
  for(int i=0;i<(N-1);i++){
    if(have == 0){
      if(A[i] < A[i+1]){
        com[i] = 1 ; // buy
        have = 1 ;
      }
    }
    else{
      if(A[i] > A[i+1]){
        com[i] = 2 ; // sell
        have = 0 ;
      }
    }
  }
  for(int i=0;i<(N-1);i++){
    if(com[i] == 1){
      kabu = money / A[i] ;
      money = money % A[i] ;
    }
    else if(com[i] == 2){
      money += kabu * A[i] ;
      kabu = 0 ;
    }
  }
  if(kabu >= 0){
    money += kabu * A[N-1] ;
  }
  cout << money << endl ;
  return 0 ;
}  