#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using LP = pair<ll, ll>;
const double PI = 3.1415926535897932;
int main() {
  int N;
  cin >> N;
  vector<int> An(N + 1, 0);
  for (int i = 0; i < (N); ++i) cin >> An[i + 1];
  vector<int> Action(N + 1, 0);
  const int BUY = 1;
  const int SELL = 2;
  Action[N] = SELL;
  for (int i = 1; i <= N; ++i) {
    int c_min = An[i];
    int c_min_idx = -1;
    int c_max = An[i];
    int c_max_idx = -1;
    for (int j = i; j <= N; ++j) {
      if (An[j] < c_min) {
        c_min_idx = j;
        c_min = An[j];
      }
      if (An[j] > c_max) {
        c_max_idx = j;
        break;
      }
    }
    if (c_max_idx != -1 && c_min_idx != -1) {
      Action[i] = SELL;
      Action[c_min_idx] = BUY;
      Action[c_max_idx] = SELL;
      i = c_max_idx;
    } else if (c_max_idx != -1) {
      Action[i] = BUY;
      i = c_max_idx;
    } else if (c_min_idx != -1) {
      Action[i] = SELL;
      i = N;
    }
  }
  int cash = 1000;
  int stock_num = 0;
  for (int i = 1; i <= N; ++i) {
    cout << i << " action " << Action[i] << endl;
    if (Action[i] == BUY && cash > An[i]) {
      stock_num = cash / An[i];
      cash -= An[i] * stock_num;
    } else if (Action[i] == SELL && stock_num > 0) {
      cash += An[i] * stock_num;
      stock_num = 0;
    }
  }
  cout << cash << endl;
  return 0;
}
