#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, MONEY = 1000, KAB = 0;
  cin >> N;
  vector<int> 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)) {
      while (MONEY - A.at(i) >= 0) {
        MONEY -= A.at(i);
        KAB++;
      }
    } else if (A.at(i) > A.at(i + 1)) {
      while (KAB > 0) {
        MONEY += A.at(i);
        KAB--;
      }
    }
  }
  while (KAB > 0) {
    MONEY += A.at(N - 1);
    KAB--;
  }
  cout << MONEY << endl;
}
