#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
long long max(long long a, long long b) {
  if (a > b)
    return a;
  else
    return b;
}
long long min(long long a, long long b) {
  if (a < b)
    return a;
  else
    return b;
}
long long gcd(long long a, long long b, long long& x, long long& y) {
  if (b == 0) {
    x = 1;
    y = 0;
    return a;
  }
  long long x1, y1;
  long long d = gcd(b, a % b, x1, y1);
  x = y1;
  y = x1 - y1 * (a / b);
  return d;
}
long long inv(long long a) {
  long long x, y;
  long long g = gcd(a, mod, x, y);
  x = (x % mod + mod) % mod;
  return x;
}
long long binpow(long long a, long long b, long long m) {
  a %= m;
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = res * a % m;
    a = a * a % m;
    b >>= 1;
  }
  return res;
}
int main() {
  int t;
  t = 1;
  while (t--) {
    int n;
    cin >> n;
    int a[n];
    for (int i = 0; i < n; i++) cin >> a[i];
    vector<int> v;
    for (int i = 1; i < n; i++) {
      if (a[i] < a[i - 1]) v.push_back(i - 1);
    }
    if (a[n - 1] > a[n - 2]) v.push_back(n - 1);
    int ans = 1000;
    int last = 0;
    int buy = 0;
    for (int u : v) {
      int mmin = 10000000;
      for (int i = last; i < u; i++) {
        mmin = min(mmin, a[i]);
      }
      last = u + 1;
      if (mmin == 10000000)
        continue;
      else {
        buy = ans / mmin;
        ans -= buy * mmin;
        ans += buy * a[u];
        buy = 0;
      }
    }
    cout << ans;
  }
  return 0;
}
