#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> itRS) {}
template <typename T, typename... Args>
void err(istream_iterator<string> itRS, T a, Args... args) {
  cerr << *itRS << " = " << a << "\n";
  err(++itRS, args...);
}
int dx[8] = {-1, -1, -1, 0, 0, 1, 1, 1};
int dy[8] = {-1, 0, 1, -1, 1, -1, 0, 1};
const int MOD = 1000000007;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(0);
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  vector<int> final_ar;
  int i = 0;
  long long int mn = 1e9;
  long long int mx = 0;
  while (i < n) {
    mn = 1e9;
    mx = 0;
    for (; i < n; i++) {
      if (v[i] <= mn) {
        mn = v[i];
      } else {
        break;
      }
    }
    final_ar.push_back(v[i - 1]);
    for (; i < n; i++) {
      if (v[i] >= mx) {
        mx = v[i];
      } else {
        break;
      }
    }
    final_ar.push_back(v[i - 1]);
  }
  if (is_sorted(v.rbegin(), v.rend()))
    cout << 1000 << "\n";
  else {
    int price = 1000;
    int stock = 0;
    for (int i = 0; i < final_ar.size(); i++) {
      if (i % 2 == 0) {
        stock = stock + price / final_ar[i];
        price = price % final_ar[i];
      } else {
        price += stock * final_ar[i];
        stock = 0;
      }
    }
    cout << price << "\n";
  }
  return 0;
}
