#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
int main() {
  int n;
  cin >> n;
  vector<int> a(n), b(n + 1);
  vector<int> s(n);
  for (int i = 0; i < (n); ++i) cin >> a[i];
  b[0] = 0;
  for (int i = 0; i < (n - 1); ++i) {
    b[i + 1] = a[i + 1] - a[i];
  }
  for (int i = 0; i < (n); ++i) s[i] = 0;
  int stock_num = 0;
  bool hav_stock = false;
  int money = 1000;
  for (int i = 0; i < (n - 1); ++i) {
    if (!hav_stock) {
      if (b[i + 1] > 0) {
        hav_stock = true;
        s[i] = 1;
      }
    } else {
      if (b[i + 1] < 0) {
        hav_stock = false;
        s[i] = -1;
      }
    }
  }
  if (b[n - 1] > 0) {
    s[n - 1] = -1;
  }
  int last_buy = -1;
  int last_sell = -1;
  for (int i = 0; i < (n); ++i) {
    if (s[n - 1 - i] == 1) {
      last_buy = n - 1 - i;
      break;
    }
  }
  for (int i = 0; i < (n); ++i) {
    if (s[n - 1 - i] == -1) {
      last_sell = n - 1 - i;
      break;
    }
  }
  if (last_buy > last_sell) {
    s[last_buy] = 0;
  }
  for (int i = 0; i < (n); ++i) {
    if (s[i] == 1) {
      stock_num = money / a[i];
      money = money % a[i];
    } else if (s[i] == -1) {
      money += a[i] * stock_num;
    }
  }
  cout << money << endl;
}
