#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  vector<int> b(n - 1);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n - 1; i++) {
    if (a[i] < a[i + 1]) {
      b[i] = 0;
    } else if (a[i] == a[i + 1]) {
      b[i] = 1;
    } else {
      b[i] = 2;
    }
  }
  bool state = 0;
  int syoji = 1000;
  int kabu = 0;
  for (int i = 0; i < n - 1; i++) {
    if (state == 0) {
      if (b[i] == 0) {
        kabu += syoji / a[i];
        syoji = syoji % a[i];
        state = 1;
      }
    } else {
      if (b[i] == 2) {
        syoji += kabu * a[i];
        kabu = 0;
        state = 0;
      }
    }
  }
  if (state == 1) {
    syoji += kabu * a[n - 1];
    kabu = 0;
    state = 0;
  }
  cout << syoji << endl;
  return 0;
}
