#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long i, j, k, l, m, n, p, q;
  while (cin >> p) {
    n = 1000;
    int x[p];
    for (i = 0; i < p; i++) cin >> x[i];
    j = 0;
    q = 0;
    for (i = 0; i < p - 1; i++) {
      q = max(q, n);
      if (x[i] < x[i + 1]) {
        j = n / x[i];
        n = n % x[i];
      } else if (x[i] > x[i + 1]) {
        n += (x[i] * j);
        j = 0;
      }
    }
    l = q / x[p - 2];
    k = q % x[p - 2];
    k += l * x[p - 1];
    q = max(q, k);
    cout << q << endl;
  }
  return 0;
}
