#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < (int)(N); i++) {
    cin >> A[i];
  }
  vector<vector<long long>> dp(N + 1, vector<long long>(3, 0));
  vector<vector<long long>> stock_num(N + 1, vector<long long>(3, 0));
  for (int i = 0; i < (int)(3); i++) {
    dp[0][i] = 1000;
  }
  pair<long long, long long> stock_first;
  pair<long long, long long> money_first;
  money_first.first = 1000;
  for (int i = 0; i < (int)(N); i++) {
    long long n_money = stock_first.second * A[i];
    long long n_stock = money_first.first / A[i] + money_first.second;
  }
  for (int ni = 0; ni < (int)(N + 1); ni++)
    for (int i = 0; i < (int)(N + 1); i++)
      for (int j = 0; j < (int)(3); j++)
        for (int nj = 0; nj < (int)(3); nj++) {
          if (ni <= i) continue;
          if (dp[ni][nj] < dp[i][j]) {
            dp[ni][nj] = dp[i][j];
            stock_num[ni][nj] = stock_num[i][j];
          }
          if (nj == 1) {
            long long buy_count = dp[i][j] / A[i];
            long long n_stock = stock_num[i][j] + buy_count;
            if (stock_num[ni][nj] < n_stock) {
              stock_num[ni][nj] = n_stock;
              dp[ni][nj] = dp[i][j] - (buy_count * A[i]);
            }
          }
          if (nj == 2) {
            long long money = stock_num[i][j] * A[i];
            long long n_money = dp[i][j] + money;
            if (dp[ni][nj] < n_money) {
              dp[ni][nj] = n_money;
              stock_num[ni][nj] = 0;
            }
          }
        }
  long long ans = 0;
  for (int i = 0; i < (int)(N + 1); i++)
    for (int j = 0; j < (int)(3); j++) {
      ans = max(dp[i][j], ans);
    }
  cout << ans << endl;
  return 0;
}
