#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int A[N + 1];
  for (int i = 1; i <= N; i++) {
    scanf("%d", &A[i]);
  }
  int m = 1000;
  int s = 0;
  int F = 1;
  while (F <= N - 1 && A[F] >= A[F + 1]) {
    F++;
  }
  if (F == N) {
    cout << m;
    return 0;
  } else {
    int in = m / A[F];
    s += in;
    m -= A[F] * in;
  }
  int L = N;
  while (L >= 2 && A[L - 1] >= A[L]) {
    L--;
  }
  for (int i = F + 1; i < L; i++) {
    if (A[i - 1] >= A[i] && A[i] <= A[i + 1]) {
      int in = m / A[i];
      s += in;
      m -= A[i] * in;
    } else if (A[i - 1] <= A[i] && A[i] >= A[i + 1]) {
      int out = s;
      s = 0;
      m += A[i] * out;
    }
  }
  int out = s;
  s = 0;
  m += A[L] * out;
  cout << m;
  return 0;
}
