#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
int main() {
  int n;
  cin >> n;
  int64_t sum = 1000, k = 0;
  int wh = 0;
  vi Ai(n);
  vi kabu(n);
  for (int i = 0; i < n; i++) {
    cin >> Ai.at(i);
  }
  if (Ai.at(0) < Ai.at(1)) {
    k = sum / Ai.at(0);
    sum %= Ai.at(0);
  }
  for (int i = 1; i < n; i++) {
    if (i == n - 1) {
      sum += k * Ai.at(i);
    } else if (Ai.at(i) < Ai.at(i + 1)) {
      k = sum / Ai.at(i);
      sum %= Ai.at(i);
      cout << sum << '\n';
    } else if (Ai.at(i) > Ai.at(i + 1)) {
      sum += k * Ai.at(i);
      k = 0;
    }
  }
  cout << sum << '\n';
  return 0;
}
