#include <bits/stdc++.h>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<int> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A.at(i);
  }
  vector<int> B(N);
  if (A.at(N - 1) >= A.at(N - 2)) {
    B.at(N - 1) = -1;
    B.at(N - 2) = 1;
  } else {
    B.at(N - 1) = 0;
    B.at(N - 2) = -1;
  }
  for (int i = N - 2; i > 0; i--) {
    if (B.at(i) == 1) {
      if (A.at(i) >= A.at(i - 1)) {
        B.at(i) = 0;
        B.at(i - 1) = 1;
      } else {
        B.at(i - 1) = -1;
      }
    } else if (B.at(i) == -1) {
      if (A.at(i) > A.at(i - 1)) {
        B.at(i - 1) = 1;
      } else {
        B.at(i) = 0;
        B.at(i - 1) = -1;
      }
    }
  }
  int money = 1000;
  int stock_cnt = 0;
  for (int i = 0; i < N; i++) {
    if (B.at(i) == 1) {
      stock_cnt += money / A.at(i);
      money = money % A.at(i);
    } else if (B.at(i) == -1) {
      money += stock_cnt * A.at(i);
      stock_cnt = 0;
    }
  }
  cout << money << endl;
  return 0;
}
