#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
using ll = long long;
using pint = pair<int, int>;
using itn = int;
using vint = vector<int>;
template <class T, class S>
inline bool chmax(T& a, S b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T, class S>
inline bool chmin(T& a, S b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <class T>
T lcm(T a, T b) {
  return a * b / gcd(a, b);
}
void yes() { cout << "Yes" << '\n'; }
void no() { cout << "No" << '\n'; }
ll buy(ll m, int v) {
  ll i = 0;
  while (i * v <= m) {
    ++i;
  }
  --i;
  return i;
}
int solve() {
  int n;
  cin >> n;
  vint a(n);
  for (int i = 0, i_len = n; (i) < (i_len); ++(i)) cin >> a[i];
  vint dp(n, 0);
  ll m = 1000;
  ll kabu = 0;
  for (int i = 0; i < n; ++i) {
    while (a[i] > a[i + 1]) {
      ++i;
      if (i >= n) {
        i = n - 1;
        break;
      }
    }
    kabu += buy(m, a[i]);
    m -= buy(m, a[i]) * a[i];
    int l = i, r;
    while (a[i] <= a[i + 1] && i < n) {
      ++i;
      if (i >= n) {
        i = n - 1;
        break;
      }
    }
    r = i;
    while (r - l >= 3) {
      m += kabu * a[l + 1];
      kabu = 0;
      kabu += buy(m, a[l + 2]);
      m -= buy(m, a[l + 2]) * a[l + 2];
      l += 2;
    }
    m += kabu * a[i];
    kabu = 0;
  }
  m += kabu * a.back();
  cout << m << endl;
  return 0;
}
int main() {
  cin.tie(0);
  cout << fixed << setprecision(10);
  ios::sync_with_stdio(false);
  solve();
  return 0;
}
