#include <bits/stdc++.h>
using namespace std;
long long int pow_mod(long long int a, long long int b) {
  long long int res = 1;
  while (b != 0) {
    if (b & 1) {
      res = (res * a) % 1000000007;
    }
    a = (a * a) % 1000000007;
    b /= 2;
  }
  return res;
}
void solve() {
  long long int n;
  cin >> n;
  long long int a[n];
  for (long long int i = 0; i < n; i++) cin >> a[i];
  long long int mx = 1000;
  for (long long int i = 0; i < n; i++) {
    long long int cost = 1000;
    long long int buy = 1000 / a[i];
    long long int rem = 1000 % a[i];
    cost = rem;
    for (long long int j = i + 1; j < n; j++) {
      if (a[j] < a[j - 1]) {
        while (j < n && a[j] < a[j - 1]) j++;
        j--;
        long long int by = cost / a[j];
        long long int rm = cost % a[j];
        buy += by;
        cost = rm;
      } else if (a[j] > a[j - 1]) {
        while (j < n && a[j] > a[j - 1]) j++;
        j--;
        long long int p = a[j] * buy;
        buy = 0;
        cost += p;
      }
      mx = max(mx, cost);
    }
  }
  cout << mx << endl;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t;
  t = 1;
  while (t--) solve();
  return 0;
}
