#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < (n); i++) cin >> a.at(i);
  vector<int> b{a.at(0)};
  int count = 0;
  for (int i = 0; i < (n - 1); i++) {
    if (a.at(i) != a.at(i + 1)) {
      b.push_back(a.at(i + 1));
    } else
      count++;
  }
  ll coin = 1000;
  int kab = 0;
  if (b.at(0) < b.at(1)) {
    kab += coin / b.at(0);
    coin = coin % b.at(0);
  }
  for (int i = 0; i < (n - 2 - count); i++) {
    if (b.at(i) < b.at(i + 1) && b.at(i + 1) > b.at(i + 2)) {
      coin += kab * b.at(i + 1);
      kab = 0;
    }
    if (b.at(i) > b.at(i + 1) && b.at(i + 1) < b.at(i + 2)) {
      kab += coin / b.at(i + 1);
      coin = coin % b.at(i + 1);
    }
  }
  if (b.at(n - 2 - count) < b.at(n - 1 - count)) {
    coin += kab * b.at(n - 1 - count);
  }
  cout << coin << endl;
}
