#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vll = vector<long long>;
using vvi = vector<vector<int> >;
using vb = vector<bool>;
template <typename T>
void take_input(vector<T> &a, int sz) {
  T t;
  for (int i = 0; i < sz; i++) {
    cin >> t;
    a.push_back(t);
  }
}
template <typename T>
void print_vector(vector<T> v) {
  for (int i = 0; i < v.size(); i++) {
    cout << v[i] << " ";
  }
  cout << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n;
  cin >> n;
  vi a;
  take_input<int>(a, n);
  vb take(n, true);
  for (int i = 0; i < n - 1; i++)
    if (a[i] == a[i + 1]) take[i + 1] = false;
  vi b;
  for (int i = 0; i < n; i++)
    if (take[i]) b.push_back(a[i]);
  a = b;
  n = a.size();
  vi label(n);
  for (int i = 1; i <= n - 2; i++) {
    if (a[i] > a[i - 1] && a[i] > a[i + 1])
      label[i] = 1;
    else if (a[i] < a[i - 1] && a[i] < a[i + 1])
      label[i] = -1;
  }
  if (a[0] < a[1]) label[0] = -1;
  if (a[n - 1] > a[n - 2]) label[n - 1] = 1;
  int s = -1, e = n;
  for (int i = 0; i < n; i++)
    if (label[i] == -1 && s == -1) s = i;
  for (int i = n - 1; i >= 0; i--)
    if (label[i] == 1 && e == n) e = i;
  if (s == -1)
    cout << 1000 << endl;
  else {
    int money = 1000;
    int num = 0;
    for (int i = s; i <= e; i++) {
      if (label[i] == -1) {
        num = money / a[i];
        money -= num * a[i];
      } else if (label[i] == 1) {
        money += num * a[i];
        num = 0;
      }
    }
    cout << money << endl;
  }
}
