#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  std::cin >> N;
  string before = "up";
  string now;
  string next = "sale";
  int val_before;
  vector<int> fc(N);
  vector<string> ud(N);
  for (int i = 0; i < N; i++) {
    std::cin >> fc[i];
  }
  val_before = fc[N - 1];
  for (int i = 0; i < N; i++) {
    if (fc[N - 1 - i - 1] > val_before) {
      now = "up";
    } else if (fc[N - 1 - i - 1] < val_before) {
      now = "down";
    } else {
      now = before;
    }
    if (next == "sale") {
      if (now == "down" && before == "up") {
        ud[N - 1 - i] = "sale";
        next = "buy";
      } else {
        ud[N - 1 - i] = "stay";
      }
    } else {
      if (now == "up" && before == "down") {
        ud[N - 1 - i] = "buy";
        next = "sale";
      } else {
        ud[N - 1 - i] = "stay";
      }
    }
    before = now;
    val_before = fc[N - 1 - i - 1];
  }
  int money = 1000;
  int kabu = 0;
  int n;
  int init_flg = 0;
  for (int i = 0; i < N; i++) {
    if (ud[i] == "sale") {
      money = money + fc[i] * kabu;
      kabu = 0;
    } else if (ud[i] == "buy") {
      n = (money - money % fc[i]) / fc[i];
      kabu = kabu + n;
      money = money - fc[i] * n;
    }
  }
  std::cout << money;
}
