#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  int n;
  cin >> n;
  vector<ll> a(n);
  vector<bool> buy(n), sell(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  ll money = 1000;
  ll money_max = 0;
  ll kabu = 0;
  buy[0] = true, sell[0] = false;
  buy[n - 1] = false, sell[n - 1] = true;
  for (int i = 1; i <= n - 2; i++) {
    if (a[i - 1] <= a[i] && a[i] > a[i + 1])
      sell[i] = true;
    else
      sell[i] = false;
    if (a[i - 1] >= a[i] && a[i] < a[i + 1])
      buy[i] = true;
    else
      buy[i] = false;
  }
  for (int i = 0; i < n; i++) {
    if (buy[i]) {
      ll num_buy = money / a[i];
      kabu += num_buy;
      money -= num_buy * a[i];
    } else if (sell[i]) {
      money += kabu * a[i];
      kabu = 0;
    }
  }
  cout << max(money, 1000LL) << endl;
  return 0;
}
