#include <bits/stdc++.h>
static const long long MAX = 1000000000000000;
static const int NIL = -1;
using namespace std;
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < (int)(n); i++) cin >> a[i];
  vector<int> g(n, 0);
  bool buy = false;
  int price;
  int Min = 10000000;
  int v = 1000;
  int num = 0;
  if (a[1] > a[0]) {
    buy = true;
    price = a[0];
    num = v / price;
    v -= price * num;
  } else {
    Min = a[1];
  }
  for (int i = 1; i < n; i++) {
    if (buy && a[i] < a[i - 1]) {
      v += a[i - 1] * num;
      buy = false;
      Min = a[i];
    } else if (!buy && a[i] > a[i - 1]) {
      buy = true;
      price = a[i - 1];
      num = v / price;
      v -= price * num;
    } else if (!buy && a[i] < a[i - 1]) {
      Min = min(Min, a[i]);
    }
  }
  if (buy) v += max(price * num, a[n - 1] * num);
  if (v < 1000)
    cout << 1000;
  else
    cout << v;
  return 0;
}
