#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<long long> a(n);
  vector<int> ex(n, 0);
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 1; i < n - 1; i++) {
    if (a[i - 1] < a[i] && a[i] >= a[i + 1]) ex[i] = 1;
    if (a[i - 1] > a[i] && a[i] <= a[i + 1]) ex[i] = -1;
  }
  if (a[0] < a[1]) ex[0] = -1;
  if (a[0] > a[1]) ex[0] = 1;
  if (a[n - 2] < a[n - 1]) ex[n - 1] = 1;
  if (a[n - 2] > a[n - 1]) ex[n - 1] = -1;
  for (int i = n - 1; i >= 0; i--) {
    if (ex[i] == 1) {
      ex[i] = 2;
      break;
    }
    if (i == 0) {
      ex[i] = 2;
    }
  }
  long long mon = 1000, kabu = 0;
  for (int i = 0; i < n; i++) {
    if (ex[i] == -1) {
      kabu = (mon / a[i]);
      mon -= kabu * a[i];
    }
    if (ex[i] == 1) {
      mon += kabu * a[i];
      kabu = 0;
    }
    if (ex[i] == 2) {
      mon += kabu * a[i];
      cout << mon << endl;
      return 0;
    }
  }
}
