#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N, kabu = 0, kane = 1000, keiki = 1;
  cin >> N;
  vector<long long> A(N);
  for (long long i = 0; i < N; i++) {
    cin >> A.at(i);
    if (i >= 1) {
      if ((A.at(i) < A.at(i - 1)) && ((keiki == 1) || (keiki == 2))) {
        keiki = 0;
        kane += kabu * A.at(i - 1);
        kabu = 0;
      } else if ((A.at(i) > A.at(i - 1)) && ((keiki == 0) || (keiki == 1))) {
        keiki = 2;
        kabu = kane / A.at(i - 1);
        kane %= A.at(i - 1);
      } else if (A.at(i) == A.at(i - 1))
        keiki = 1;
    }
  }
  cout << kane + kabu * A.at(N - 1) << endl;
}
