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