#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int tmp;
  vector<int> a;
  for (int i = 0; i < n; i++) {
    cin >> tmp;
    if (a.size() == 0 || tmp != a[a.size() - 1]) {
      a.push_back(tmp);
    }
  }
  priority_queue<pair<int, int>, vector<pair<int, int>>,
                 greater<pair<int, int>>>
      minmax;
  for (int i = 0; i < a.size(); i++) {
    if (i >= 2) {
      if (a[i - 2] < a[i - 1] && a[i] < a[i - 1]) {
        minmax.emplace(i - 1, -1);
      } else if (a[i - 2] > a[i - 1] && a[i] > a[i - 1]) {
        minmax.emplace(i - 1, 1);
      }
    }
  }
  if (a[0] < a[1])
    minmax.emplace(0, 1);
  else
    minmax.emplace(0, -1);
  if (a[a.size() - 1] > a[a.size() - 2]) minmax.emplace(a.size() - 1, -1);
  int m = 1000;
  int stock = 0;
  while (!minmax.empty()) {
    auto [pos, sign] = minmax.top();
    minmax.pop();
    if (sign > 0 && !minmax.empty()) {
      stock += m / a[pos];
      m = m % a[pos];
    } else {
      m += stock * a[pos];
      stock = 0;
    }
  }
  cout << m << endl;
}
