#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vec = vector<ll>;
using vect = vector<double>;
using Graph = vector<vector<ll>>;
ll ctoi(char c) {
  if (c >= '0' && c <= '9') {
    return c - '0';
  }
  return -1;
}
template <typename T>
T lcm(T x, T y) {
  T z = __gcd(x, y);
  return x * y / z;
}
template <typename T>
bool primejudge(T n) {
  if (n < 2)
    return false;
  else if (n == 2)
    return true;
  else if (n % 2 == 0)
    return false;
  double sqrtn = sqrt(n);
  for (T i = 3; i < sqrtn + 1; i++) {
    if (n % i == 0) {
      return false;
    }
    i++;
  }
  return true;
}
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
int main() {
  cout << fixed << setprecision(30);
  ll N;
  cin >> N;
  vec A(N);
  for (ll i = 0; i < N; i++) cin >> A[i];
  vec sale;
  vec buy;
  bool up = false;
  bool down = false;
  for (ll i = 0; i < N - 1; i++) {
    if (A[i] < A[i + 1]) {
      if (down) buy.push_back(i);
      up = true;
      down = false;
    }
    if (A[i] > A[i + 1]) {
      if (up) sale.push_back(i);
      down = true;
      up = false;
    }
  }
  if (A[N - 1] > A[N - 2]) sale.push_back(N - 1);
  ll x = buy.size(), y = sale.size();
  if (y > x) buy.push_back(0);
  sort(sale.begin(), sale.end());
  sort(buy.begin(), buy.end());
  vec check;
  for (ll i = 0; i < sale.size(); i++) check.push_back(sale[i]);
  for (ll i = 0; i < buy.size(); i++) check.push_back(buy[i]);
  sort(check.begin(), check.end());
  ll z = check.size();
  ll ans = 1000, kabu = 0;
  for (ll i = 0; i < z; i++) {
    ll ind = check[i];
    if (i % 2 == 0) {
      ll change = ans / A[ind];
      kabu += change;
      ans -= A[ind] * kabu;
    } else {
      ans += kabu * A[ind];
      kabu = 0;
    }
  }
  cout << ans << endl;
  return 0;
}
