#include <bits/stdc++.h>
using namespace std;
long long n, a[200100], money = 1000, kabu = 0;
bool checkmin(int start) {
  int i;
  for (i = start + 1; i < n; i++) {
    if (a[start] >= a[i]) {
      return false;
    }
  }
  return true;
}
bool checkmax(int start) {
  int i;
  for (i = start + 1; i < n; i++) {
    if (a[start] <= a[i]) {
      return false;
    }
  }
  return true;
}
bool checkminmax(int start) {
  int i, minf = 0, maxf = 0, minidx, maxidx;
  for (i = start + 1; i < n; i++) {
    if (a[start] > a[i] && minf == 0) {
      minf = 1;
      minidx = i;
    }
    if (a[start] < a[i] && maxf == 0) {
      maxf = 1;
      maxidx = i;
    }
  }
  if (minf == 1 && maxf == 1 && minidx < maxidx)
    return true;
  else
    return false;
}
int main() {
  int i, j;
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (i = 0; i < n; i++) {
    if (checkmin(i)) {
      kabu += money / a[i];
      money = money % a[i];
    } else if (checkmax(i)) {
      money += kabu * a[i];
      kabu = 0;
    } else if (checkminmax(i)) {
      money += kabu * a[i];
      kabu = 0;
    }
  }
  money += kabu * a[i - 1];
  return 0;
}
