#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n;
  cin >> n;
  ll a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  ll kane = 1000;
  ll kabu = 0;
  ll sell = 0;
  ll last = -1;
  bool buy_turn = true;
  for (int day = 0; day < n; day++) {
    ll now = a[day];
    if (day == n - 1 && kabu != 0) {
      kane += kabu * now;
      kabu = 0;
      break;
    }
    if (buy_turn) {
      if (now == last) continue;
      ll mx_kane = 0;
      ll mx_day;
      for (int i = day + 1; i < n; i++) {
        if (mx_kane < a[i]) {
          mx_kane = a[i];
          mx_day = i;
        }
      }
      ll tmp_kane = now;
      ll tmp_kane2, tmp_day;
      int step = 0;
      for (int i = day + 1; i < n; i++) {
        if (step == 0) {
          if (tmp_kane < a[i]) {
            step++;
            tmp_kane = a[i];
            tmp_kane2 = a[i];
            tmp_day = i;
          }
        } else if (step == 1) {
          if (tmp_kane > a[i]) {
            step++;
            tmp_kane = a[i];
          }
        } else if (step == 2) {
          if (tmp_kane < a[i]) {
            step++;
            tmp_kane = a[i];
          }
        }
        if (step == 3) {
          mx_kane = tmp_kane2;
          mx_day = tmp_day;
        }
      }
      if (now < mx_kane) {
        kabu = kane / now;
        kane -= kabu * now;
        sell = a[mx_day];
        buy_turn = false;
      } else {
      }
    } else {
      if (now == sell) {
        kane += kabu * now;
        kabu = 0;
        buy_turn = true;
      }
    }
    last = now;
  }
  cout << kane << endl;
  return 0;
}
