#include <bits/stdc++.h>
using namespace std;
const long long N = 81;
long long a[N], n;
long long nxt1[N], nxt2[N];
long long f(long long idx) {
  long long r = 0, cash = 1000, cnt = 0, x = 1;
  while (idx) {
    if (x) {
      cnt += cash / a[idx];
      cash %= a[idx];
      idx = nxt2[idx];
    } else {
      cash += cnt * a[idx];
      r = max(r, cash);
      cnt = 0;
      idx = nxt1[idx];
    }
    x ^= 1;
  }
  return r;
}
int32_t main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (long long i = 1; i <= n; i++) {
    for (long long j = n; j > i; j--) {
      if (a[i] > a[j]) {
        nxt1[i] = j;
      }
      if (a[i] < a[j]) {
        nxt2[i] = j;
      }
    }
  }
  long long ans = 1000;
  for (long long i = 1; i < n; i++) {
    ans = max(ans, f(i));
  }
  cout << ans << endl;
}
