#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  int A[N];
  for (int i = 0; i < N; i++) cin >> A[i];
  int firstBuyPoint = N;
  int nextUp = A[N - 1];
  for (int i = N - 1; i >= 0; i--) {
    if (A[i] < nextUp) {
      firstBuyPoint = i;
      nextUp = A[i];
    } else if (A[i] > nextUp) {
      nextUp = A[i];
    }
  }
  if (firstBuyPoint == N) {
    cout << 1000;
    return 0;
  }
  long long haveSuryo = 1000 / A[firstBuyPoint];
  long long haveMoney = 1000 - A[firstBuyPoint] * haveSuryo;
  int havePrice = A[firstBuyPoint];
  int nextBuyPoint = 0;
  for (int i = firstBuyPoint + 1; i < N; i++) {
    if (i < nextBuyPoint) {
      continue;
    }
    if (havePrice < A[i]) {
      haveMoney += A[i] * haveSuryo;
      haveSuryo = 0;
      havePrice = 0;
    }
    if (haveSuryo == 0) {
      int nowPrice = A[i];
      for (int j = i + 1; j < N; j++) {
        if (nowPrice < A[i]) {
          nextBuyPoint = j;
          haveSuryo = haveMoney / A[j];
          haveMoney -= A[j] * haveSuryo;
          havePrice = A[j];
          break;
        }
        nowPrice = min(A[j], nowPrice);
      }
    }
  }
  cout << haveMoney;
}
