#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<vector<int>> a;
  vector<int> tmp;
  int num1, num2;
  cin >> num1;
  tmp.push_back(num1);
  for (int i = 1; i < n; i++) {
    cin >> num2;
    if (num2 > num1) {
      tmp.push_back(num2);
      num1 = num2;
      if (i == n - 1) {
        a.push_back(tmp);
      }
    } else {
      a.push_back(tmp);
      tmp = {num2};
      num1 = num2;
    }
  }
  int sisan = 1000;
  for (auto aa : a) {
    int size = aa.size();
    if (size > 1) {
      int moti = sisan / aa.at(0);
      sisan -= aa.at(0) * moti;
      sisan += aa.at(size - 1) * moti;
      moti = 0;
    }
  }
  cout << sisan << endl;
}
