#include <bits/stdc++.h>
using namespace std;
size_t monodecend(size_t i, const vector<int>& A) {
  int Min = A.at(i);
  for (size_t j = i + 1; j < A.size(); j++) {
    if (Min >= A.at(j)) {
      Min = A.at(j);
    } else {
      return j;
    }
  }
  return A.size();
}
size_t monoincend(size_t i, const vector<int>& A) {
  int Max = A.at(i);
  for (size_t j = i + 1; j < A.size(); j++) {
    if (Max <= A.at(j)) {
      Max = A.at(j);
    } else {
      return j;
    }
  }
  return A.size();
}
int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A.at(i);
  }
  vector<int> Sin;
  for (int i = 0; i < N;) {
    i = monodecend(i, A);
    if (i == N) {
      break;
    }
    Sin.push_back(A.at(i - 1));
    i = monoincend(i, A);
    Sin.push_back(A.at(i - 1));
    if (i == N) {
      break;
    }
  }
  int money = 1000;
  int stock;
  for (size_t i = 0; i < Sin.size(); i += 2) {
    stock = money / Sin.at(i);
    money %= Sin.at(i);
    money += stock * Sin.at(i + 1);
  }
  cout << money << endl;
}
