#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int A[N + 1];
  for (int i = 1; i <= N; ++i) cin >> A[i];
  bool flag;
  int ans[2];
  for (int k = 0; k <= 1; ++k) {
    flag = k;
    int balance = 1000;
    int stock = 0;
    for (int i = 1; i < N; ++i) {
      if (flag) {
        if (A[i + 1] < A[i]) {
          balance += stock * A[i];
          stock = stock - stock;
          flag = 0;
        }
      } else {
        if (A[i + 1] > A[i]) {
          if (balance >= 0) {
            stock += balance / A[i];
            balance -= A[i] * stock;
            flag = 1;
          }
        }
      }
      ans[k] = balance + stock * A[N];
    }
  }
  cout << (ans[0] >= ans[1] ? ans[0] : ans[1]) << endl;
}
