#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
int main() {
  int n;
  cin >> n;
  vi a(n);
  for (int i = 0; i < (int)(n); i++) {
    cin >> a[i];
  }
  vi buy_day;
  vi sell_day;
  for (int now_day = 0; now_day < (int)(n); now_day++) {
    if (now_day == n - 1) {
      sell_day.push_back(now_day);
    } else {
      if (a[now_day + 1] > a[now_day]) {
        buy_day.push_back(now_day);
      } else if (a[now_day + 1] < a[now_day]) {
        sell_day.push_back(now_day);
      }
    }
  }
  ll ans = 1000;
  ll kabu = 0;
  for (int i = 0; i < (int)(n); i++) {
    if (!buy_day.empty() && buy_day.front() == i) {
      buy_day.erase(buy_day.begin());
      int buy_num = ans / a[i];
      kabu += buy_num;
      ans -= a[i] * buy_num;
    } else if (!sell_day.empty() && sell_day.front() == i) {
      sell_day.erase(sell_day.begin());
      ans += a[i] * kabu;
      kabu = 0;
    }
  }
  cout << ans << endl;
}
