#include <bits/stdc++.h>
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
using namespace std;
using ll = long long;
const ll MOD = 1000000007;
const ll INF = MOD * MOD;
const int inf = (1 << 29);
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < (n); i++) cin >> a[i];
  int genkin = 1000 % a[0];
  int kabu = 1000 / a[0];
  for (int i = 0; i < n - 1; i++) {
    if (a[i] > a[i + 1]) {
      genkin += kabu * a[i];
      kabu = 0;
    }
    if (a[i] < a[i + 1]) {
      kabu += genkin / a[i];
      genkin %= a[i];
    }
  }
  int res = genkin + kabu * a[n - 1];
  cout << res << endl;
  return 0;
}
