#include <bits/stdc++.h>
using namespace std;
int arr[85], n;
queue<int> p, v;
void m1() {
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> arr[i];
  for (int i = 1; i < n - 1; ++i) {
    if (arr[i] >= arr[i - 1] && arr[i + 1] < arr[i]) p.push(i);
    if (arr[i] <= arr[i - 1] && arr[i + 1] > arr[i]) v.push(i);
  }
  int cur = 1000, stock = 0, res = 1000;
  bool buy;
  if (p.front() < v.front()) {
    stock = cur / arr[0];
    cur %= arr[0];
    buy = false;
    int i = p.front();
    p.pop();
    while (true) {
      if (buy) {
        stock = cur / arr[i];
        cur %= arr[i];
        if (p.empty()) {
          cur += stock * arr[n - 1];
          cout << max(res, cur);
          return;
        } else {
          i = p.front();
          p.pop();
          buy = false;
        }
      } else {
        cur += stock * arr[i];
        stock = 0;
        res = max(res, cur);
        if (v.empty()) {
          cout << res;
          return;
        } else {
          i = v.front();
          v.pop();
          buy = true;
        }
      }
    }
  } else {
    buy = true;
    int i = v.front();
    v.pop();
    while (true) {
      if (buy) {
        stock = cur / arr[i];
        cur %= arr[i];
        if (p.empty()) {
          cur += stock * arr[n - 1];
          cout << max(cur, res);
          return;
        } else {
          i = p.front();
          p.pop();
          buy = false;
        }
      } else {
        cur += stock * arr[i];
        stock = 0;
        res = max(res, cur);
        if (v.empty()) {
          cout << res;
          return;
        } else {
          i = v.front();
          v.pop();
          buy = true;
        }
      }
    }
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  ;
  m1();
}
