#include <bits/stdc++.h>
using namespace std;
int main() {
  bool aaa = false;
  int64_t N;
  cin >> N;
  vector<int64_t> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A.at(i);
  }
  for (int i = 0; i < N - 1; i++) {
    if (!(A.at(i) <= A.at(i + 1))) {
      aaa = true;
    }
  }
  int64_t ans = 1000;
  int chk = 201;
  int ansp;
  if (aaa) {
    for (int i = 0; i < N - 1; i++) {
      if ((A.at(i) < A.at(i + 1)) && !(i == N - 1) && (ans > A.at(i))) {
        ansp = ans / A.at(i);
        ans = ans % A.at(i);
        chk = A.at(i);
        continue;
      }
      if (chk < A.at(i)) {
        ans = ans + ansp * A.at(i);
        chk = 201;
      }
    }
    if (ans <= 200) ans = ans + ansp * A.at(N - 1);
    cout << ans << endl;
  } else {
    sort(A.begin(), A.end());
    ansp = ans / A.at(0);
    ans = ans % A.at(0);
    ans = ans + ansp * A.at(N - 1);
    cout << ans << endl;
  }
}
