#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n, ans = 1000, val = 0, pos = 0;
  cin >> n;
  vector<long long> A(n);
  for (long long i = 0; i < n; ++i) cin >> A[i];
  while (pos < n) {
    if (pos + 1 < n) {
      if (A[pos] > A[pos + 1]) {
        long long pos_ = pos + 1;
        while (pos_ + 1 < n && A[pos_] > A[pos_ + 1]) pos_++;
        if (pos_ + 1 < n) {
          val = ans / A[pos_];
          ans -= A[pos_] * val;
        }
        pos = pos_;
      } else if (A[pos] < A[pos + 1]) {
        if (pos == 0) {
          val = ans / A[pos];
          ans -= A[pos] * val;
        }
        long long pos_ = pos + 1;
        while (pos_ + 1 < n && A[pos_] < A[pos_ + 1]) pos_++;
        ans += A[pos_] * val;
        pos = pos_;
      } else
        pos++;
    } else
      pos++;
  }
  cout << (ans) << endl;
  return 0;
}
