#include <bits/stdc++.h>
using namespace std;
vector<long long> ara;
long long calc(long long taka, long long mini, long long maxi) {
  long long div = taka / mini;
  long long rem = taka % mini;
  rem += (div * maxi);
  return rem;
}
int main() {
  long long n;
  scanf("%lld", &n);
  for (long long i = 0; i < n; i++) {
    long long a;
    scanf("%lld", &a);
    ara.push_back(a);
  }
  bool mark = true;
  long long taka = 1000;
  long long stock = 0;
  long long mini = 1000, maxi = 1000;
  for (long long i = 0; i < ara.size(); i++) {
    if (mark == true) {
      if (ara[i] < maxi) {
        taka = calc(taka, mini, maxi);
        mini = ara[i];
        mark = false;
      } else {
        maxi = max(maxi, ara[i]);
      }
    } else if (mark == false && ara[i] > mini) {
      if (ara[i] > mini) {
        maxi = ara[i];
        mark = true;
      } else {
        mini = min(mini, ara[i]);
      }
    }
  }
  if (mark) taka = calc(taka, mini, maxi);
  cout << taka << endl;
  return 0;
}
