#include <bits/stdc++.h>
using namespace std;
int N;
bool able = true;
vector<int> A(90, 0);
vector<int> dp(90, 0);
int main() {
  cin >> N;
  for (int i = 1; i <= N; i++) cin >> A[i];
  for (int i = N; i > 0; i--) dp[i] = max(A[i], dp[i + 1]);
  int money = 1000;
  int n = 0;
  int i = 1;
  while (i + 1 <= N) {
    if (money < money % A[i] + money / A[i] * dp[i + 1]) break;
    ++i;
  }
  if (i == N) able = false;
  n = money / A[i];
  money %= A[i];
  i += 1;
  int val;
  while (i <= N) {
    int d = 0;
    int pmax = 0;
    while (i + d < N && A[i] <= A[i + d]) {
      pmax = max(pmax, A[i + d]);
      ++d;
    }
    if (n * dp[i] >=
        (n * pmax) % A[i + d] + (n * pmax) / A[i + d] * dp[i + d]) {
      money += n * dp[i];
      break;
    }
    money = (n * pmax) % A[i + d];
    n = (n * pmax) / A[i + d];
    i += d;
  }
  if (able)
    cout << money << endl;
  else
    cout << 1000 << endl;
  return 0;
}
