#include <bits/stdc++.h>
using namespace std;
long long arr[85], n;
deque<long long> p, v;
void m1() {
  cin >> n;
  for (long long i = 0; i < n; ++i) cin >> arr[i];
  for (long long i = 1; i < n - 1; ++i) {
    if (arr[i] >= arr[i - 1] && arr[i + 1] < arr[i]) p.push_back(i);
    if (arr[i] <= arr[i - 1] && arr[i + 1] > arr[i]) v.push_back(i);
  }
  long long cur = 1000, stock = 0, res = 1000;
  bool buy = true;
  if (p.size() == 0 && v.size() == 0) {
    if (arr[0] >= arr[n - 1])
      cout << 1000;
    else {
      stock = cur / arr[0];
      cur %= arr[0];
      cout << cur + stock * arr[n - 1];
    }
    return;
  }
  if (p[0] < v[0]) v.push_front(0);
  if (*(--p.end()) < *(--v.end())) p.push_back(n - 1);
  long long x = p.size();
  long long i = 0, j = 0, k = 0;
  for (k = v[0]; i < x;) {
    if (buy) {
      stock = cur / arr[k];
      cur %= arr[k];
      k = p[j];
      ++j;
      buy = false;
    } else {
      cur += stock * arr[k];
      stock = 0;
      ++i;
      k = v[i];
      buy = true;
    }
  }
  cout << cur;
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  ;
  m1();
}
