#include <bits/stdc++.h>
using namespace std;
int main() {
  int t = 1;
  while (t--) {
    int n;
    cin >> n;
    std::vector<int> v(n);
    for (int i = 0; i < n; ++i) {
      cin >> v[i];
    }
    stack<int> maxstack, minstack;
    int daulat = 1000, number, stocks = 0;
    maxstack.push(v[0]), minstack.push(v[0]);
    for (int i = 0; i < n - 1; ++i) {
      if (v[i] < v[i + 1]) {
        number = daulat / minstack.top();
        stocks += number;
        daulat -= number * minstack.top();
        maxstack.push(v[i + 1]);
      }
      if (v[i] > v[i + 1]) {
        daulat += stocks * maxstack.top();
        stocks = 0;
        minstack.push(v[i + 1]);
      }
    }
    cout << daulat + stocks * maxstack.top();
  }
  return 0;
}
