#include <bits/stdc++.h>
using namespace std;
bool isPrime(long long n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
bool isPowerOfTwo(unsigned long long x) { return (!(x & (x - 1))); }
vector<long long> prime;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  srand(static_cast<unsigned>(time(0)));
  long long t = 1;
  while (t--) {
    long long n, c, i;
    cin >> n;
    long long a[n];
    for (long long i = 0; i < n; ++i) cin >> a[i];
    long long p = 1000;
    for (i = 0; i < n - 1; i++) {
      if (a[i] < a[i + 1]) {
        c = 1000 / a[i];
        p = 1000 - a[i] * c;
        i++;
        break;
      }
    }
    for (; i < n - 1; i++) {
      if (a[i] > a[i - 1]) {
        long long sell = c * a[i];
        p += sell;
        c = 0;
      } else if (a[i] < a[i - 1]) {
        if (p == 0) break;
        long long cnt = p / a[i];
        c += cnt;
        p -= a[i] * cnt;
      }
    }
    p += c * a[n - 1];
    cout << p << '\n';
  }
  return 0;
}
