#include <bits/stdc++.h>
using namespace std;
const int64_t mod = 1000000007;
const int64_t tmpMod = 998244353;
int main() {
  int64_t N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i];
  }
  bool buy = false, sell = false;
  int high = 0;
  int stock = 0, price = 0, money = 1000;
  for (int i = 0; i < N; i++) {
    int tmp = A[i];
    buy = false;
    sell = false;
    for (int j = i + 1; j < N; j++) {
      if (tmp == A[j]) continue;
      high = max(high, A[j]);
      if (stock == 0 && tmp < A[j]) buy = true;
      if (tmp > A[j]) sell = true;
      if (sell) break;
    }
    if (i == N - 1 && price < A[N - 1]) sell = true;
    if (buy && stock == 0) {
      stock = money / A[i];
      price = A[i];
      money %= price;
    }
    if (sell) {
      money += stock * A[i];
      stock = 0;
      high = 0;
    }
  }
  if (stock > 0) {
    money += stock * price;
  }
  cout << money << endl;
}
