#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ll n = 0;
  cin >> n;
  vector<ll> nedan(n);
  for (ll i = 0; i < n; i++) {
    cin >> nedan[i];
  }
  ll money = 1000;
  ll kabu = 0;
  ll tmpNedan = nedan[0];
  ll MAX = nedan[0];
  ll MIN = nedan[0];
  for (ll i = 1; i < n; i++) {
    if (kabu == 0) {
      if (MIN < nedan[i]) {
        kabu = money / MIN;
        money -= kabu * MIN;
        MAX = nedan[i];
        MIN = 1001;
      } else {
        MIN = nedan[i];
      }
    } else {
      if (MAX > nedan[i]) {
        money = kabu * MAX;
        kabu = 0;
        MIN = nedan[i];
        MAX = 0;
      } else {
        MAX = nedan[i];
      }
    }
    tmpNedan = nedan[i];
  }
  cout << money + kabu * MAX << endl;
  return 0;
}
