#include <bits/stdc++.h>
using namespace std;
struct __ {
  __() {
    ios_base::Init i;
    ios_base::sync_with_stdio(0);
    cin.tie(0);
  }
} __;
inline int nxt() {
  int x;
  scanf("%d", &x);
  return x;
}
vector<int> a;
int n;
inline bool is_min(int i) {
  if (i == 0 or a[i - 1] > a[i]) {
    if (i == n - 1 or a[i + 1] > a[i]) return true;
  }
  return false;
}
inline bool is_max(int i) {
  if (i == 0 or a[i - 1] < a[i]) {
    if (i == n - 1 or a[i + 1] < a[i]) return true;
  }
  return false;
}
struct growing_sector {
  int min_ind;
  int max_ind;
  bool complete;
  growing_sector(int min_ind = -1, int max_ind = n + 1, bool complete = false) {
    this->min_ind = min_ind;
    this->max_ind = max_ind;
    this->complete = complete;
  }
};
int main() {
  n = nxt();
  vector<int> a_dirty(n);
  for (int i = 0; i < n; ++i) {
    a_dirty[i] = nxt();
  }
  a.push_back(a_dirty[0]);
  for (int i = 1; i < n; ++i) {
    if (a_dirty[i] != a_dirty[i - 1]) {
      a.push_back(a_dirty[i]);
    }
  }
  int n = a.size();
  bool theres_min = false;
  vector<growing_sector> sectors;
  int sect_count = 0;
  for (int i = 0; i < n; ++i) {
    if (is_min(i)) {
      theres_min = true;
      sectors.push_back(growing_sector(i));
      ++sect_count;
      continue;
    }
    if (theres_min && is_max(i)) {
      sectors[sect_count - 1].max_ind = i;
      sectors[sect_count - 1].complete = true;
      theres_min = false;
    }
  }
  int cash = 1000;
  for (growing_sector sct : sectors) {
    if (sct.complete) {
      int toBuy = floor(cash / a[sct.min_ind]);
      cash += (a[sct.max_ind] - a[sct.min_ind]) * toBuy;
    }
  }
  cout << cash << '\n';
  return 0;
}
