#include <bits/stdc++.h>
struct A {
  int money;
  int kabu;
  int max;
  int index;
};
A kau(const A& sisan, int price) {
  A result = sisan;
  int n = result.money / price;
  result.money -= n * price;
  result.kabu += n;
  ++result.index;
  return result;
}
A uru(const A& sisan, int price) {
  A result = sisan;
  result.money += result.kabu * price;
  result.kabu = 0;
  result.max = std::max(result.max, result.money);
  ++result.index;
  return result;
}
long solve(int n, const std::vector<int>& prices) {
  long result = 1000;
  std::queue<A> queue;
  queue.push({1000, 0, 1000, 0});
  while (!queue.empty()) {
    auto s = queue.front();
    queue.pop();
    if (s.money > result) result = s.money;
    if (s.index >= n) continue;
    auto p = prices[s.index];
    if (s.kabu > 0) {
      if (s.money + s.kabu * p > s.max) queue.push(uru(s, p));
    }
    if (s.index < n - 1) {
      if (s.money > 0) queue.push(kau(s, p));
      ++s.index;
      queue.push(s);
    }
  }
  return result;
}
int main() {
  int n;
  std::cin >> n;
  std::vector<int> prices(n);
  for (auto& p : prices) {
    std::cin >> p;
  }
  std::cout << std::setprecision(20);
  std::cout << solve(n, prices) << std::endl;
}
