#include <bits/stdc++.h>
using namespace std;
bool compPair(const pair<int, int>& arg1, const pair<int, int>& arg2) {
  return arg1.first > arg2.first;
}
bool compTuple(const tuple<long long, long long, long long>& arg1,
               const tuple<long long, long long, long long>& arg2) {
  return get<2>(arg1) > get<2>(arg2);
}
template <class T>
void chmax(T& a, T b) {
  if (a < b) {
    a = b;
  }
}
template <class T>
void chmin(T& a, T b) {
  if (a > b) {
    a = b;
  }
}
int main(void) {
  int n;
  cin >> n;
  vector<int> a(n + 1);
  int mx = 0, cnt = 0;
  for (int in = 0; in < n; in++) {
    cin >> a[in];
    if (mx < a[in]) mx = a[in];
  }
  for (int in = 1; in < n; in++) {
    if (a[in - 1] > a[in]) cnt++;
  }
  cnt++;
  if (mx == a[0]) {
    cout << 1000 << endl;
    return 0;
  }
  if (cnt == 1) {
    sort(a.begin(), a.end());
    int s1, m1 = 1000;
    s1 = m1 / a[1];
    m1 -= s1 * a[1];
    m1 += s1 * a[n];
    cout << m1 << endl;
    return 0;
  }
  int m = 1000, p = a[0], s, icnt = 0;
  for (int in = 1; in < n + 1; in++) {
    if (a[in - 1] <= a[in])
      continue;
    else {
      icnt++;
      if (icnt == cnt && p >= a[n - 1]) {
        m += p * s;
        break;
      } else if (icnt == cnt && p < a[n - 1]) {
        m += a[n - 1] * s;
        break;
      } else {
        s = m / p;
        m -= s * p;
        m += s * a[in - 1];
        s = m / a[in];
        p = a[in];
        m -= s * p;
      }
    }
  }
  cout << m << endl;
  return 0;
}
