#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < (n); ++i) cin >> a[i];
  int ans = 1000 - (1000 / a[0]) * a[0];
  int kabu = 1000 / a[0];
  for (int i = 1; i < n - 1; i++) {
    if (a[i] < a[i - 1]) {
      kabu += ans / a[i];
      ans -= ans / a[i] * a[i];
    } else if (a[i] > a[i - 1]) {
      ans += kabu * a[i];
      kabu = 0;
    } else
      continue;
  }
  ans += kabu * a[n - 1];
  cout << max(ans, 1000) << endl;
  return 0;
}
