#include <bits/stdc++.h>
using namespace std;
const int maxn = 111;
int n, a[maxn];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  int l = 0, r = 1;
  vector<pair<int, int> > box;
  while (l < n && r < n) {
    if (a[r] >= a[r - 1]) {
      r++;
    } else {
      box.push_back(make_pair(a[l], a[r - 1]));
      l = r;
      r++;
    }
  }
  if (l < r - 1) box.push_back(make_pair(a[l], a[r - 1]));
  int len = box.size();
  int mon = 1000;
  for (int i = 0; i < len; i++) {
    int by = box[i].first;
    int sl = box[i].second;
    int num = mon / by;
    mon = mon % by;
    mon += sl * num;
  }
  cout << mon << endl;
  return 0;
}
