#include <bits/stdc++.h>
using namespace std;
long long binpow(long long a, long long b, long long m) {
  a %= m;
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = res * a % m;
    a = a * a % m;
    b >>= 1;
  }
  return res;
}
void solve() {
  int n;
  cin >> n;
  int a[n];
  for (__typeof(n) i = (0) - ((0) > (n)); i != (n) - ((0) > (n));
       i += 1 - 2 * ((0) > (n)))
    cin >> a[i];
  int mx = 1000;
  int curr = 1000, st = 0;
  for (__typeof(n) i = (0) - ((0) > (n)); i != (n) - ((0) > (n));
       i += 1 - 2 * ((0) > (n))) {
    if (i == 0 and a[i] < a[i + 1] and i + 1 < n) {
      int r = 1000 / a[i];
      st += r;
      curr -= (r * a[i]);
    } else if (a[i] > a[i - 1] and a[i] > a[i + 1] and i + 1 < n) {
      curr += st * a[i];
      st = 0;
      mx = max(curr, mx);
    } else if (a[i] < a[i - 1] and a[i] < a[i + 1] and i + 1 < n) {
      int r = curr / a[i];
      st += curr / a[i];
      curr -= r;
    } else if (i == n - 1 and a[i] > a[i - 1]) {
      curr += st * a[i];
      st = 0;
      mx = max(mx, curr);
    }
  }
  cout << mx << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
