#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  long long n, s = 1000, c = 0, c1 = 0, i, j;
  cin >> n;
  long long a[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  if (is_sorted(a, a + n)) {
    for (i = 0; i < n - 1; i++) {
      if (s < a[i]) break;
      c += s / a[i];
      s = s - c * a[i];
    }
    s += c * a[n - 1];
    cout << s;
  } else if (is_sorted(a, a + n, greater<long long>()))
    cout << s;
  else {
    for (i = 0; i < n - 1; i++) {
      if (a[i] < a[i + 1] && s > a[i]) {
        c += s / a[i];
        s = s - c * a[i];
      } else if (a[i] > a[i + 1] && c != 0) {
        s = s + c * a[i];
        c = 0;
      } else {
        for (j = i + 1; j < n - 1; j++) {
          if (a[j] > a[j + 1]) {
            c1 = 1;
            break;
          }
        }
        if (c1 == 1) {
          s = s + c * a[i];
          c = 0;
        }
      }
    }
    s = s + c * a[n - 1];
    cout << s;
  }
  return 0;
}
