#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  long long n;
  cin >> n;
  long long money = 1000;
  long long stocks = 0;
  long long a[n + 1];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  a[n] = 0;
  long long high = 1000;
  long long prec = 2000;
  for (long long i = 0; i < n; i++) {
    if (a[i] < prec) {
      while (money >= a[i]) {
        money -= a[i];
        stocks += 1;
      }
    }
    if (a[i] > a[i + 1]) {
      while (stocks >= 1) {
        money += a[i];
        stocks -= 1;
      }
    }
    if (money > high) high = money;
  }
  cout << high << endl;
  return 0;
}
