#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n;
  cin >> n;
  long long arr[n];
  long long money = 1000;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  vector<long long> low, high;
  for (int i = 0; i < n - 1; i++) {
    if (arr[i] < arr[i + 1] && (i == 0 || arr[i - 1] >= arr[i])) {
      low.push_back(arr[i]);
    }
  }
  for (int i = 1; i < n; i++) {
    if (arr[i] >= arr[i - 1] && (i == n - 1 || arr[i + 1] < arr[i])) {
      high.push_back(arr[i]);
    }
  }
  for (int i = 0; i < low.size() && i < high.size(); i++) {
    long long x = money / low[i];
    money = money - x * low[i];
    money += x * high[i];
  }
  cout << money << endl;
}
