#include <bits/stdc++.h>
using namespace std;
const int INF = 1001001001;
const int MOD = 1000000007;
const double PI = acos(-1);
int main() {
  int N;
  cin >> N;
  vector<int> A;
  for (int i = 0; i < (N); i++) {
    int a;
    cin >> a;
    if (i > 0) {
      if (a == A.back()) continue;
    }
    A.push_back(a);
  }
  N = A.size();
  int m, p;
  m = 1000;
  p = 0;
  bool next_buy = true;
  int kai = INF;
  for (int i = 0; i < (N); i++) {
    if (next_buy) {
      int next_up;
      int next_min;
      next_min = A[i];
      next_up = A[i];
      for (int j = i + 1; j < N; j++) {
        if (A[j] > A[i]) {
          next_up = A[j];
          break;
        }
        next_min = min(A[j], next_min);
      }
      if (next_min == A[i] && next_up > A[i]) {
        p = m / A[i];
        m = m % A[i];
        next_buy = false;
        kai = A[i];
      }
    } else {
      bool uru = false;
      if (A[i] > kai) {
        if (i == N - 1) {
          uru = true;
        } else if (A[i] > A[i + 1]) {
          uru = true;
        }
      }
      if (uru) {
        m += p * A[i];
        p = 0;
        next_buy = true;
        kai = INF;
      }
    }
  }
  cout << m << endl;
}
