#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < (int)(N); i++) cin >> a[i];
  vector<vector<int>> vec(N, vector<int>(3));
  vec[0] = {1000 / a[0], 1000 % a[0], 1000};
  for (int i = 1; i < N; i++) {
    int stock_num = vec[i - 1][0];
    int money = vec[i - 1][1];
    int tot = vec[i - 1][2];
    if (a[i] >= a[i - 1]) {
      tot = a[i] * stock_num + money;
      vec[i] = {tot / a[i], tot % a[i], tot};
    } else {
      vec[i] = {tot / a[i], tot % a[i], tot};
    }
  }
  int M1 = vec[N - 1][2];
  int index = 1;
  for (; index < N; index++) {
    if (a[index - 1] >= a[index]) {
      continue;
    }
  }
  vector<vector<int>> vec2(N, vector<int>(3));
  vec2[index - 1] = {1000 / a[index - 1], 1000 % a[index - 1], 1000};
  for (int i = index; i < N; i++) {
    int stock_num = vec2[i - 1][0];
    int money = vec2[i - 1][1];
    int tot = vec2[i - 1][2];
    if (a[i] > a[i - 1]) {
      tot = a[i] * stock_num + money;
      vec2[i] = {tot / a[i], tot % a[i], tot};
    } else {
      vec2[i] = {tot / a[i], tot % a[i], tot};
    }
  }
  int M2 = vec2[N - 1][2];
  cout << max(M1, M2) << endl;
}
