#include <bits/stdc++.h>
using namespace std;
using namespace std;
long long m(long long a) {
  return ((a % 1000000007) + 1000000007) % 1000000007;
}
long long p(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = m(m(res) * m(a));
    a = m(m(a) * m(a));
    b >>= 1;
  }
  return res;
}
signed main() {
  ;
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (long long i = 0; i < n; i++) cin >> a[i];
  long long mn = -1, mx = -1;
  long long moni = 1000;
  for (long long i = 0; i < n; i++) {
    if (mn == -1) {
      mn = a[i];
      continue;
    }
    if (a[i] <= mn) {
      mn = a[i];
      continue;
    }
    if (a[i] > mx) {
      mx = a[i];
    } else {
      if (mx == -1) {
        mn = a[i];
      } else {
        long long num = (moni / mn);
        moni -= num * mn;
        moni += num * mx;
        mx = -1;
        mn = -1;
      }
    }
  }
  if (mx != -1 && mn != -1) {
    long long num = (moni / mn);
    moni -= num * mn;
    moni += num * mx;
  }
  cout << moni << '\n';
  cerr << "\nTime elapsed : " << 1000 * clock() / CLOCKS_PER_SEC << " ms\n";
}
