#include <bits/stdc++.h>
using namespace std;
using UL = unsigned int;
using ULL = unsigned long long;
using LL = long long;
int main() {
  int N;
  scanf("%d", &N);
  vector<int> A = vector<int>(N, 1);
  vector<int> max_ind;
  for (int i = 0; i < (N); i++) scanf("%d ", &A[i]);
  int min, max, mod, stock;
  int money = 1000;
  max_ind.push_back(0);
  for (int i = 0; i < (N); i++) {
    if (A[i + 1] - A[i] < 0) {
      max_ind.push_back(i);
    }
  }
  priority_queue<int> pq;
  for (int max_i = 1; max_i < max_ind.size(); max_i++) {
    pq = priority_queue<int>();
    for (int i = max_ind[max_i - 1]; i < max_ind[max_i]; i++) {
      max = A[max_ind[max_i]];
      min = A[i];
      mod = money % min;
      stock = (money / min);
      pq.push(max * stock + mod);
    }
    money = pq.top();
  }
  cout << money << endl;
  return 0;
}
