#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < (int)(n); i++) {
    cin >> a[i];
  }
  int ans = 1000;
  int kabu = 0;
  string d;
  bool first = 1;
  if (a[0] < a[1])
    d = "up";
  else if (a[0] > a[1])
    d = "down";
  else
    d = "even";
  for (int i = 0; i < (int)(n - 1); i++) {
    if (i != 0) {
      if (a[i - 1] > a[i]) d = "down";
      if (a[i - 1] < a[i]) d = "up";
    }
    if (a[i] < a[i + 1] && (d == "down" || first)) {
      first = 0;
      kabu += ans / a[i];
      ans = ans % a[i];
    } else if (a[i] > a[i + 1] && (d == "up" || first)) {
      first = 0;
      ans += kabu * a[i];
      kabu = 0;
    }
  }
  ans += kabu * a[n - 1];
  kabu = 0;
  cout << ans << endl;
}
