#include <bits/stdc++.h>
using namespace std;
int INF = 1001001001;
int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < (N); ++i) {
    cin >> A[i];
  }
  vector<int> Y(100, INF);
  vector<int> T(100);
  int ycnt = 0;
  int tcnt = 0;
  for (int i = 0; i < (N); ++i) {
    if (i == N - 1) {
      if (A[i] > Y[ycnt]) {
        T[tcnt] = A[i];
      }
      continue;
    }
    if (A[i] < A[i + 1]) {
      Y[ycnt] = min(Y[ycnt], A[i]);
    } else if (A[i] > A[i + 1]) {
      T[tcnt] = A[i];
      ycnt++;
      tcnt++;
    }
  }
  long long now = 1000;
  long long kabu = 0;
  int yn = 0;
  int tn = 0;
  while (T[tn] != 0 && Y[yn] != INF) {
    long long kau = now / Y[yn];
    kabu += kau;
    now -= Y[yn] * kau;
    now += T[tn] * kabu;
    kabu = 0;
    tn++;
    yn++;
  }
  cout << now << endl;
  return 0;
}
