#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (long long i = 0; i < (long long)(n); i++) {
    cin >> a[i];
  }
  int b = 0;
  long long c = 1000;
  for (long long i = 0; i < (long long)(n - 1); i++) {
    if (a[i] < a[i + 1] && b == 0) {
      int j = i;
      while (a[j] > a[j + 1] && j <= n - 3) {
        j++;
      }
      b = c / a[j];
      c -= b * a[j];
      i = j - 1;
    }
    if (b != 0 && a[i] > a[i + 1]) {
      int k = i;
      while (a[k] < a[k + 1] && k <= n - 3) {
        k++;
      }
      c += b * a[k];
      b = 0;
      i = k - 1;
    }
    if (i == n - 2 && b != 0) {
      c += b * max(a[i], a[i + 1]);
      b = 0;
    }
  }
  cout << c;
}
