#include <bits/stdc++.h>
using namespace std;
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int saisyo = a[0];
  vector<int> temp = a;
  sort(temp.begin(), temp.end());
  if (saisyo == temp[n - 1]) {
    cout << "1000" << endl;
    return 0;
  }
  int kane = 1000;
  int kabu = 0;
  if (a[0] < a[1]) {
    kabu += kane / a[0];
    kane = kane % a[0];
  }
  for (int i = 1; i < n - 1; i++) {
    if (a[i] >= a[i - 1] && a[i] >= a[i + 1]) {
      kane += kabu * a[i];
      kabu = 0;
    }
    if (a[i] <= a[i - 1] && a[i] <= a[i + 1]) {
      kabu += kane / a[i];
      kane = kane % a[i];
    }
  }
  if (a[n - 1] >= a[n - 2]) {
    kane += kabu * a[n - 1];
    kabu = 0;
  }
  cout << kane << endl;
  return 0;
}
