#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll N;
  cin >> N;
  vector<ll> A(N);
  for (ll i = 0; i < N; i++) cin >> A[i];
  ll side = 1;
  ll money = 1000;
  ll stock = 0;
  ll temp = 0;
  ll profit = 0;
  temp = money / A[0];
  money -= (temp * A[0]);
  stock += temp;
  for (ll i = 1; i < N; i++) {
    if (side == 1) {
      if (A[i] < A[i - 1]) {
        temp = money / A[i - 1];
        money += (temp * A[i - 1]);
        stock -= temp;
        temp = money / A[i];
        money -= (temp * A[i]);
        stock += temp;
      } else {
        profit = stock * A[i];
        money += (profit);
        stock = 0;
        side = -1;
      }
    } else {
      if (A[i] > A[i - 1]) {
        money -= profit;
        stock += profit / A[i - 1];
        profit = stock * A[i];
        money += (profit);
        stock = 0;
      } else {
        temp = money / A[i];
        money -= (temp * A[i]);
        stock += temp;
        side = 1;
      }
    }
  }
  ll ans = max(money + stock * A[N - 1], (ll)1000);
  cout << ans << '\n';
  return 0;
}
