#include<bits/stdc++.h>
#include <vector>
#include <algorithm>
using namespace std;
using UL = unsigned int;
using Uint = unsigned long long;
using int = long long;

#define rep(i,n) for(int i=0; i<(n); i++)

int cash(int money, int max, int min){
      // 株価の端数で現金が余る
      int mod = money%min;
      int stock = (money/min);
      return stock*max + mod;
}
int N;
vector<int> A;
int rec(int money, int stock, int day, int ops){
  if (day >= N) return money;
  // 購入
  if(ops == 1){
    stock += money/A[day];
    money = money%A[day];
  } else if (ops == 2){
    money += stock*A[day]; 
    stock = 0;
   
  }
  money = max(max(money, rec(money, stock, day+1, 0)),
          max(rec(money, stock, day+1, 1),rec(money, stock, day+1, 2)));
  return money;
}
int main() {
  scanf("%d", &N);
  A = vector<int>(N+1, (int)0);
  vector<int> T = vector<int>(N+1, (int)0);
  vector<int> max_ind;
  rep(i, N) scanf("%d ", &A[i]);

  T[0] = 1000;
  rep(i,N){
  // kは買う日
    for (int k = 0; k < i+1; k++){
      // jは売る日
      for (int j = k; j < i+1; j++){      
          int tmp =cash(T[k], A[j], A[k]);
          if(T[i+1] < tmp) T[i+1] = tmp;
      } 
    }

    
  }
  int maxval = 0;
  rep(i, N+1){
    maxval = max(T[i],maxval);
  }
  cout << maxval <<endl;

  return 0;
}

