#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, ca, ma, sh, f = 0;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  ma = a[0];
  sh = 1000 / ma;
  ca = 1000 % ma;
  for (long long i = 1; i < n; i++) {
    if (a[i] > ma && f == 0) {
      ca = (a[i] * sh) + ca;
      ma = a[i];
      f = 1;
    } else if (a[i] < ma && f == 1) {
      sh = ca / a[i];
      ca = ca % a[i];
      ma = a[i];
      f = 0;
    }
  }
  if (f == 0)
    cout << ca + (sh * ma);
  else
    cout << ca;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) {
    solve();
  }
}
