#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < (n); i++) cin >> a[i];
  bool trendUp = false;
  bool changed = false;
  for (int i = 0; i < (n - 1); i++) {
    if (a[i] < a[i + 1]) {
      trendUp = true;
      changed = true;
      break;
    }
    if (a[i] > a[i + 1]) {
      trendUp = false;
      changed = true;
      break;
    }
  }
  if (!changed) {
    cout << 1000 << endl;
    return 0;
  }
  map<int, long long> buyMap;
  map<int, long long> sellMap;
  long long money = 1000;
  long long stock = 0;
  if (trendUp) {
    int buyCnt = money / a[0];
    money -= buyCnt * a[0];
    stock += buyCnt;
  }
  for (int i = 0; i < (n); i++) {
    if (trendUp) {
      if (a[i] > a[i + 1]) {
        sellMap[i] = a[i];
        trendUp = false;
      }
    } else {
      if (a[i] < a[i + 1]) {
        buyMap[i] = a[i];
        trendUp = true;
      }
    }
  }
  for (int i = 0; i < (n); i++) {
    if (sellMap[i] > 0) {
      money += sellMap[i] * stock;
      stock = 0;
    } else if (buyMap[i] > 0) {
      int buyCnt = money / buyMap[i];
      money -= buyCnt * buyMap[i];
      stock += buyCnt;
    }
    if (i == n - 1) {
      money += a[i] * stock;
      stock = 0;
    }
  }
  cout << money << endl;
}
