#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 100000000;
int main() {
  ll n;
  ll a[80];
  vector<ll> valley, mountain;
  cin >> n;
  pair<ll, ll> point;
  bool up_flag;
  for (int i = 0; i < (n); ++i) {
    cin >> a[i];
  }
  if (a[0] > a[1]) {
    up_flag = false;
  } else {
    up_flag = true;
    valley.push_back(0);
  }
  for (ll i = 0; i < n - 1; ++i) {
    if (up_flag && a[i] > a[i + 1]) {
      mountain.push_back(i);
      up_flag = false;
    } else if (!up_flag && a[i] < a[i + 1]) {
      valley.push_back(i);
      up_flag = true;
    }
  }
  if (up_flag && a[n - 1] > a[n - 2]) {
    mountain.push_back(n - 1);
  } else if (!up_flag && a[n - 1] > a[n - 2]) {
    valley.push_back(n - 2);
    mountain.push_back(n - 1);
  } else if (!up_flag && a[n - 1] < a[n - 2]) {
    valley.push_back(n - 1);
  }
  ll m = 1000, s = 0;
  if (mountain.empty()) {
    cout << m;
    return 0;
  } else if (valley.empty()) {
    cout << (1000 / a[0]) * a[n - 1];
    return 0;
  }
  int mi = 0, vi = 0;
  for (ll i = 0; i < n; ++i) {
    if (i == mountain[mi]) {
      m = m + s * a[i];
      s = 0;
      mi++;
    } else if (i == valley[vi]) {
      s = m / a[i];
      m = m % a[i];
      vi++;
    }
    if (mi >= mountain.size()) {
      cout << m;
      return 0;
    }
  }
  cout << m;
  return 0;
}
