#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];
  bool flg = 1;
  vector<int> b;
  for (int i = 0; i < n - 1; ++i) {
    if (flg && a[i] < a[i + 1]) {
      b.push_back(i);
      flg = 0;
    } else if (!flg && a[i] > a[i + 1]) {
      b.push_back(i);
      flg = 1;
    }
  }
  if (!flg && a[n - 2] < a[n - 1]) {
    b.push_back(n - 1);
  }
  int m = b.size(), money = 1000, stock = 0;
  for (int i = 0; i < m; ++i) {
    if (i % 2 == 0) {
      stock += money / a[b[i]];
      money %= a[b[i]];
    } else {
      money += stock * a[b[i]];
      stock = 0;
    }
  }
  cout << money << endl;
}
