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