#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, stock = 0, money = 1000, a = 0, b = 0;
  cin >> n;
  vector<int> A(0);
  cin >> b;
  for (int i = 0; i < n - 1; ++i) {
    cin >> a;
    if (A.size() % 2 == 0 && a > b)
      A.push_back(b);
    else if (A.size() % 2 == 1 && a < b)
      A.push_back(b);
    if (i == n - 2) {
      if (A.size() % 2 == 0 && a < b)
        A.push_back(a);
      else if (A.size() % 2 == 1 && a > b)
        A.push_back(a);
    }
    b = a;
  }
  for (int i = 0; i < A.size() - 1; ++i) {
    if (A.at(i) < A.at(i + 1)) {
      stock = money / A.at(i);
      money %= A.at(i);
    } else if (A.at(i) > A.at(i + 1)) {
      money += stock * A.at(i);
      stock = 0;
    }
    if (i == A.size() - 2) money += stock * max(A.at(i), A.at(i + 1));
  }
  cout << money << endl;
  return 0;
}
