#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<ll>;
using vv = vector<vi>;
using P = pair<int, int>;
using T = tuple<int, int, int>;
int main(void) {
  int n;
  cin >> n;
  vi a(n);
  for (int i = 0; i < (n); i++) cin >> a[i];
  ll ans = 1000;
  ll num = 0;
  int lastsell = n - 1;
  while (lastsell > 0 && a[lastsell - 1] >= a[lastsell]) {
    lastsell--;
  }
  int firstbuy = 0;
  while (firstbuy < n - 1 && a[firstbuy] >= a[firstbuy + 1]) {
    firstbuy++;
  }
  if (firstbuy < lastsell) {
    num = ans / a[firstbuy];
    ans -= num * a[firstbuy];
  } else {
    cout << 1000 << endl;
    return 0;
  }
  for (int i = firstbuy + 1; i <= lastsell; i++) {
    if (i == n - 1) {
      if (a[i - 1] <= a[i]) {
        ans += num * a[i];
        num = 0;
      }
    } else {
      if (a[i - 1] <= a[i] && a[i] > a[i + 1]) {
        ans += num * a[i];
        num = 0;
      } else if (a[i - 1] > a[i] && a[i] <= a[i + 1]) {
        num += ans / a[i];
        ans -= num * a[i];
      }
    }
  }
  cout << ans << endl;
  return 0;
}
