#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long mn = 1000;
  int st = 0;
  vector<int> maxs;
  for (int i = 1; i < n - 1; i++) {
    if (a[i] > a[i + 1] && a[i] >= a[i - 1]) {
      maxs.push_back(a[i]);
    }
  }
  if (a[n - 1] > a[n - 2]) {
    maxs.push_back(a[n - 1]);
  }
  int index = 0;
  int pre = 0;
  bool f = true;
  if (maxs.size()) {
    for (int i = 0; i < n - 1; i++) {
      if (a[i] != maxs[index] && mn > a[i] && f) {
        st += mn / a[i];
        mn -= st * a[i];
        f = false;
      } else if (a[i] >= a[i + 1]) {
        mn += a[i] * st;
        st = 0;
        index++;
        f = true;
      }
    }
  }
  mn += a[n - 1] * st;
  cout << mn << endl;
}
