#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int mon = 1000;
  int cab = 0;
  int k = 0;
  bool flag = true;
  vector<int> c(0);
  vector<int> d(0);
  while (a[k] > a[k + 1] && k < 80) {
    k++;
  }
  while (k < 80) {
    if (flag) {
      for (int i = k; i < n; i++) {
        if (a[i] < a[i + 1]) {
          c.push_back(i);
          k = i;
          flag = false;
          continue;
        }
      }
    } else {
      for (int i = k; i < n; i++) {
        if (a[i] > a[i + 1]) {
          d.push_back(i);
          k = i;
          flag = true;
          continue;
        }
      }
    }
  }
  for (int i = 0; i < d.size(); i++) {
    cab = mon / a[c[i]];
    mon -= cab * a[c[i]];
    mon += cab * a[d[i]];
  }
  cout << mon << endl;
  return 0;
}
