#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using PL = pair<long long, long long>;
using Pxy = pair<double, double>;
using T = tuple<int, int, bool>;
const int INF = 1001001007;
const int mod = 1000000007;
const int MOD = 998244353;
const ll inf = 1e18;
template <typename AT>
void printvec(vector<AT> &ar) {
  for (int i = 0; i < (ar.size() - 1); ++i) cout << ar[i] << " ";
  cout << ar[ar.size() - 1] << endl;
}
template <typename Q>
void printvvec(vector<vector<Q>> &ar) {
  for (int i = 0; i < (ar.size()); ++i) {
    for (int j = 0; j < (ar[0].size() - 1); ++j) cout << ar[i][j] << " ";
    cout << ar[i][ar[0].size() - 1] << endl;
  }
}
template <typename S>
bool range(S a, S b, S x) {
  return (a <= x && x < b);
}
void yn(int o) {
  if (o == 0)
    cout << "No" << endl;
  else
    cout << "Yes" << endl;
}
int main() {
  int n;
  cin >> n;
  int ans = 1000;
  int kb = 0;
  vector<int> arr(n);
  for (int i = 0; i < (n); ++i) cin >> arr[i];
  vector<int> ar;
  ar.emplace_back(arr[0]);
  for (int i = 0; i < (n - 1); ++i)
    if (arr[i] != arr[i + 1]) ar.emplace_back(arr[i + 1]);
  if (ar.size() == 1) {
    cout << 1000 << endl;
    return 0;
  }
  ar.insert(ar.begin(), ar[1]);
  n = ar.size() - 1;
  for (int i = 0; i < (n - 1); ++i) {
    if (ar[i] <= ar[i + 1] && ar[i + 1] >= ar[i + 2]) {
      ans += kb * ar[i + 1];
      kb = 0;
    }
    if (ar[i] >= ar[i + 1] && ar[i + 1] <= ar[i + 2]) {
      kb += ans / ar[i + 1];
      ans %= ar[i + 1];
    }
  }
  if (kb > 0) ans += kb * ar[n];
  cout << ans << endl;
}
