#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) cin >> A[i];
  long long money = 1000, stock = 0;
  for (int i = 1; i < N; i++) {
    if (A[i - 1] < A[i]) {
      while (money >= A[i - 1]) {
        money -= A[i - 1];
        stock++;
      }
      while (stock > 0) {
        stock--;
        money += A[i];
      }
    }
  }
  cout << money << endl;
}
