#include <bits/stdc++.h>
int main(int argc, char *argv[]) {
  int n;
  std::cin >> n;
  std::vector<int> a(n);
  std::vector<int> urikai(n, 0);
  std::vector<int> d;
  d.push_back(0);
  bool ok = false;
  for (int i = 0; i < n; ++i) {
    std::cin >> a.at(i);
    if (i > 0) {
      d.push_back(a.at(i) - a.at(i - 1));
      if (d.back() > 0) ok = true;
    }
  }
  if (!ok) {
    std::cout << 1000 << std::endl;
    return 0;
  }
  urikai.back() = -1;
  for (int i = n - 1; i >= 1; --i) {
    if (d.at(i) <= 0 && d.at(i - 1) > 0) urikai.at(i) = -1;
    if (d.at(i) >= 0 && d.at(i - 1) < 0) urikai.at(i) = 1;
  }
  for (int i = 0; i < n; ++i)
    if (urikai.at(i) < 0) {
      urikai.at(0) = 1;
      break;
    }
  int money = 1000, kabu = 0;
  for (int i = 0; i < n; ++i) {
    if (urikai.at(i) > 0) {
      kabu += money / a.at(i);
      money %= a.at(i);
    }
    if (urikai.at(i) < 0) {
      money += a.at(i) * kabu;
      kabu = 0;
    }
  }
  std::cout << money << std::endl;
}
