#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
  ll n;
  cin >> n;
  vector<ll> a(n);
  for (ll i = 0; i < (ll)(n); i++) cin >> a[i];
  ll x = 1000 / a[0];
  ll ans = 1000;
  for (ll i = (0); i <= (x); i++) {
    ll k = i;
    ll l = 1000 - i * a[0];
    for (ll i = (1); i <= (n - 1); i++) {
      if (a[i] == a[i - 1]) continue;
      if (a[i] > a[i - 1]) {
        l += a[i] * k;
        k = 0;
        ans = max(ans, l);
      } else {
        ll buy = l / a[i];
        k += buy;
        l -= a[i] * buy;
        ans = max(ans, l);
      }
    }
  }
  cout << ans << endl;
}
