#include <bits/stdc++.h>
using namespace std;
double f[1005][5], a[1005];
signed main() {
  long long n;
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    a[i] /= 1000;
  }
  f[0][0] = 1000;
  for (long long i = 1; i <= n; i++) {
    double max0 = 0, max1 = 0;
    for (long long j = 0; j < i; j++) {
      if (max0 < f[j][0]) {
        max0 = f[j][0];
      }
      if (max1 < f[j][1]) {
        max1 = f[j][1];
      }
    }
    f[i][1] = max0 * a[i];
    f[i][0] = max1 / a[i];
  }
  double maxv = 0;
  for (long long i = 0; i <= n; i++) {
    if (maxv < f[i][0]) {
      maxv = f[i][0];
    }
  }
  cout << (long long)maxv;
  return 0;
}
