#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long maxi = *max_element(a, a + n);
  long long st = 0, ans = 0;
  if (a[0] >= maxi)
    cout << 1000 << "\n";
  else {
    st = 1000 / a[0];
    ans += (1000 - (st * a[0]));
    long long prev = 0;
    for (long long i = 1; i < n; i++) {
      if (a[i] >= a[prev]) {
        ans += (st * a[i]);
        st -= st;
        prev = i;
      } else if (a[i] < prev) {
        st = ans / a[i];
        ans -= (st * a[i]);
        prev = i;
      }
    }
    cout << ans << "\n";
  }
  return 0;
}
