#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  long long money = 1000;
  long long cnt = 0;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  bool have = false;
  for (long long i = 0; i < n; i++) {
    if (have) {
      if (i == n - 1) {
        while (cnt > 0) {
          money += a[i];
          cnt--;
        }
        continue;
      }
      if (a[i] < a[i + 1]) {
        continue;
      }
      while (cnt > 0) {
        money += a[i];
        cnt--;
      }
      have = false;
    } else {
      if (i == n - 1) {
        continue;
      }
      if (a[i] > a[i + 1]) {
        continue;
      }
      while (money >= a[i]) {
        money -= a[i];
        cnt++;
      }
      have = true;
    }
  }
  cout << money << endl;
  return 0;
}
