#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<double, double>;
ll mod = 1000000007LL;
int main() {
  int n;
  cin >> n;
  vector<ll> as;
  int prev = -1;
  for (int i = 0; i < (int)(n); i++) {
    int cur;
    cin >> cur;
    if (prev == cur) continue;
    as.push_back(cur);
    prev = cur;
  }
  vector<ll> bs;
  if (as[0] < as[1]) {
    bs.push_back(as[0]);
  }
  for (int i = 1; i < as.size() - 1; i++) {
    if (as[i - 1] < as[i] && as[i] > as[i + 1]) {
      bs.push_back(as[i]);
    } else if (as[i - 1] > as[i] && as[i] < as[i + 1]) {
      bs.push_back(as[i]);
    }
  }
  if (as[as.size() - 2] < as[as.size() - 1]) {
    bs.push_back(as[as.size() - 1]);
  }
  ll money = 1000;
  for (int i = 0; i < bs.size(); i += 2) {
    ll stock = money / bs[i];
    money -= bs[i] * stock;
    money += bs[i + 1] * stock;
  }
  cout << money << endl;
  return 0;
}
