#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 10;
long long a[N];
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  for (long long i = 0; i < n; ++i) cin >> a[i];
  long long mn = a[0];
  vector<long long> v;
  if (a[1] > a[0]) v.push_back(a[0]);
  for (long long i = 1; i < n; ++i) {
    if (a[i] > a[i - 1]) {
      while (i < n && a[i] >= a[i - 1]) ++i;
      --i;
      v.push_back(a[i]);
    } else {
      while (i < n && a[i] <= a[i - 1]) ++i;
      --i;
      v.push_back(a[i]);
    }
  }
  long long ans = 0;
  long long cost = 1000;
  long long stock = 0;
  if (v.size() > 1) {
    for (long long i = 0; i < v.size(); ++i) {
      if (i & 1) {
        cost += stock * v[i];
        stock = 0;
      } else {
        stock += cost / v[i];
        cost %= v[i];
      }
      ans = max(ans, cost);
    }
  }
  cout << ans;
  return 0;
}
