#include <bits/stdc++.h>
using namespace std;
using P = pair<long long, long long>;
using V = vector<long long>;
long long n;
V a;
V dp;
bool is_min(long long idx) {
  for (long long i = idx; i <= n; i++) {
    if (a[idx] > a[i]) {
      return false;
    }
  }
  return true;
}
void solve_abc_d() {
  long long h, w;
  long long k;
  long long l_ans = 0;
  cin >> n;
  a = V(n + 5);
  for (long long i = 0; i < (long long)(n); i++) cin >> a[i + 1];
  dp = V(n + 5);
  dp[0] = 1000;
  priority_queue<P> stock;
  long long tmp;
  bool sell;
  dp[0] = 1000;
  for (long long i = 1; i <= (long long)(n); i++) {
    sell = false;
    while (stock.size()) {
      tmp = -stock.top().first;
      if (i == n) {
        dp[i] = dp[i - 1] + a[i] * stock.top().second;
        stock.pop();
        sell = true;
      } else if (tmp < a[i]) {
        dp[i] = dp[i - 1] + a[i] * stock.top().second;
        stock.pop();
        sell = true;
      } else {
        break;
      }
    }
    if (!sell) {
      if (i != n && is_min(i)) {
        if (dp[i - 1] / a[i] > 0) {
          dp[i] = dp[i - 1] - (dp[i - 1] / a[i]) * a[i];
          stock.push(make_pair(-a[i], dp[i - 1] / a[i]));
        } else {
          dp[i] = dp[i - 1];
        }
      } else {
        dp[i] = dp[i - 1];
      }
    }
  }
  cout << dp[n] << "\n";
  return;
}
int main(void) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed;
  cout << setprecision(15);
  solve_abc_d();
  return 0;
}
