#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
template <class T>
bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int N;
  cin >> N;
  vector<ll> A(N);
  for (int i = 0; i < N; i++) cin >> A.at(i);
  for (int i = 1; i < N; i++) {
    if (A.at(i - 1) == A.at(i)) {
      A.erase(A.begin() + i);
      i--;
      N--;
    }
  }
  for (int i = 2; i < N; i++) {
    if (A.at(i - 2) <= A.at(i - 1) && A.at(i - 1) <= A.at(i)) {
      A.erase(A.begin() + i - 1);
      i--;
      N--;
    }
  }
  for (int i = 2; i < N; i++) {
    if (A.at(i - 2) >= A.at(i - 1) && A.at(i - 1) >= A.at(i)) {
      A.erase(A.begin() + i - 1);
      i--;
      N--;
    }
  }
  for (int i = 1; i < N; i++) {
    if (A.at(i) <= A.at(0)) {
      A.erase(A.begin() + i);
      i--;
      N--;
    } else
      break;
  }
  if (N - 2 >= 0) {
    if (A.at(N - 2) >= A.at(N - 1)) {
      A.pop_back();
      N--;
    }
  }
  ll X = 1000;
  for (int i = 0; i < N - 1; i += 2) {
    ll tmp = X / A.at(i);
    X -= tmp * A.at(i);
    X += tmp * A.at(i + 1);
  }
  cout << X << endl;
  return 0;
}
