#include <bits/stdc++.h>
using namespace std;
mt19937 mrand(random_device{}());
const long long mod = 1000000007;
int rnd(int x) { return mrand() % x; }
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= mod;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long modInverse(long long a) {
  long long p = mod - 2;
  return powmod(a, p);
}
void solve() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (auto &x : a) cin >> x;
  a.resize(std::distance(a.begin(), std::unique(a.begin(), a.end())));
  n = ((int)(a).size());
  int ans = 1000, s = 0;
  for (int i = 0; i < n; i++) {
    if ((i == 0 or a[i] < a[i - 1]) and (i < (n - 1) and a[i] < a[i + 1])) {
      s += ans / a[i], ans %= a[i];
    }
    if ((i == 0 or a[i] > a[i - 1]) and (i == (n - 1) or a[i] > a[i + 1])) {
      ans += a[i] * s, s = 0;
    }
  }
  cout << ans << "\n";
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL);
  solve();
}
