#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int temp;
  long syoji = 1000;
  long kabun;
  cin >> n;
  vector<int> a(n, 0);
  for (int i = 0; i < n; i++) {
    cin >> a.at(i);
  }
  kabun = 0;
  temp = 0;
  for (int i = 0; i < n - 1; i++) {
    temp = 0;
    if (a.at(i) < a.at(i + 1)) {
      while (syoji >= a.at(i)) {
        syoji -= a.at(i);
        kabun++;
      }
      syoji -= a.at(i) * kabun;
    } else if (a.at(i) > a.at(i + 1)) {
      syoji = syoji + (a.at(i) * kabun);
      kabun = 0;
    }
  }
  if (kabun > 0) {
    syoji = syoji + (a.at(n - 1) * kabun);
  }
  cout << syoji << endl;
  return (0);
}
