#include <bits/stdc++.h>
using namespace std;
const char en = '\n';
int main() {
  long long n, i, arr[100], ans = 1000, buyp = (int(1e9));
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> arr[i];
  }
  buyp = arr[0];
  for (i = 1; i < n; i++) {
    if (arr[i] < buyp) buyp = arr[i];
    if (arr[i] > buyp && buyp > 0) {
      cout << buyp << endl;
      int nstock = ans / buyp;
      ans = (ans % buyp == 0) ? 0 : ans - (nstock * buyp);
      ans += (nstock * arr[i]);
      buyp = (int(1e9));
    }
  }
  cout << ans << endl;
  return 0;
}
