#include <bits/stdc++.h>
using namespace std;
template <class T>
inline istream& operator>>(istream& c, vector<T>& A) {
  for (int i = 0; i < (A.size()); ++i) c >> A[i];
  return c;
}
const long long linf = (1ll << 61);
const int inf = 1001001001;
const int mod = 1000000007;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  cin >> a;
  int now_y = 1000, now_c = 0;
  bool turn = true;
  for (int i = 0; i < (n); ++i) {
    if (turn) {
      bool ok = false;
      for (int j = i + 1; j < n; ++j) {
        if (a[j] > a[i]) ok = true;
      }
      if (ok) {
        turn = false;
        now_c += now_y / a[i];
        now_y %= a[i];
      }
    } else {
      int j = i + 1;
      for (; j < n; ++j) {
        if (a[j] <= a[i]) break;
      }
      j--;
      now_y += a[j] * now_c;
      now_c = 0;
      i = j;
      turn = true;
    }
  }
  cout << now_y << endl;
  return 0;
}
