#include <bits/stdc++.h>
using namespace std;
const long long LongINF = 1e13 + 7;
const int INF = 1e9 + 7;
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T, class Y>
T GCD(T a, Y b) {
  if (a < b) {
    int c = a;
    a = b;
    b = c;
  }
  if (a % b == 0) {
    return b;
  }
  return GCD(b, a % b);
}
template <class T, class Y>
T LCM(T a, Y b) {
  return (a * b) / GCD(a, b);
}
void clear(queue<pair<int, int>>& q) {
  queue<pair<int, int>> empty;
  swap(q, empty);
}
using vi = vector<int>;
using vii = vector<vi>;
int main() {
  long long n, money = 1000, t = 0;
  cin >> n;
  vi a(n);
  vector<bool> b(n, false), c(n, false);
  for (long long i = (0); i < (n); i++) {
    cin >> a[i];
  }
  for (long long i = (0); i < (n - 1); i++) {
    long long m;
    for (long long j = (i); j < (n - 1); j++) {
      if (a[j] >= a[j + 1]) {
        m = j;
        break;
      }
    }
    i = m;
    b[m] = true;
  }
  for (long long i = (0); i < (n - 1); i++) {
    if (a[i] < a[i + 1]) c[i] = true;
  }
  for (long long i = (0); i < (n); i++) {
    if (b[i] && t != 0) {
      money += t * a[i];
      t = 0;
    } else {
      if (money >= a[i] && c[i]) {
        t = money / a[i];
        money -= t * a[i];
      }
    }
  }
  cout << money << endl;
  return 0;
}
