#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
const int INF = 0x3f3f3f3f;
const long long mod = 1e9 + 7;
const long long N = 1e6 + 5;
int n, a[N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i];
  vector<int> q;
  q.push_back(a[1]);
  for (int i = 2; i < n; i++) {
    if (q.size() && a[i] > q.back() && a[i] > a[i + 1]) {
      int id = q.size();
      if (a[id - 1] > a[id - 2]) q.pop_back();
      q.push_back(a[i]);
    } else if (q.size() && a[i] < q.back() && a[i] < a[i + 1]) {
      int id = q.size();
      if (a[id - 1] < a[id - 2]) q.pop_back();
      q.push_back(a[i]);
    }
  }
  if (q.size() && a[n] > q.back()) q.push_back(a[n]);
  long long ans = 1000, cnt = 0;
  for (int i = 0; i < q.size(); i++) {
    if (q[i] > q[i + 1]) {
      if (cnt) {
        ans += cnt * q[i];
        cnt = 0;
      }
    } else {
      if (ans) {
        cnt += ans / q[i];
        ans -= ans / q[i] * q[i];
      }
    }
  }
  cout << ans << '\n';
  return 0;
}
