#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int a[n];
  vector<int> age[n];
  vector<int> sage[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n - 1; i++) {
    for (int j = i + 1; j < n; j++) {
      if (a[i] > a[j])
        sage[i].push_back(j);
      else if (a[i] < a[j])
        age[i].push_back(j);
    }
  }
  int kane = 1000;
  int kabu = 0;
  int day = 0;
  while (1) {
    if (kabu == 0 && age[day].size() > 0) {
      kabu = kane / a[day];
      kane -= kabu * a[day];
      if (sage[age[day].at(0)].size() > 0) {
        kane += kabu * a[age[day].at(0)];
        kabu = 0;
        day = sage[age[day].at(0)].at(0);
      } else {
        int MAX = day;
        for (auto u : age[day])
          if (a[MAX] < a[u]) MAX = u;
        kane += kabu * a[MAX];
        kabu = 0;
        break;
      }
    } else if (kabu == 0 && age[day].size() == 0)
      break;
  }
  cout << kane;
}
